Recent searches
No recent searches
Notify webhook for new ticket comments
Answered
Posted Oct 01, 2021
I'm trying to setup a webhook to get notified on all new comments for a Ticket. I'd like to have the id, comment, and comment author to be sent via JSON to my webhook. Right now I have it somewhat working with the following body:
{
"id": "{{ticket.id}}",
"comment": "{{ticket.comments[0]}}",
}
But unfortunately something like this doesn't work:
{
"id": "{{ticket.id}}",
"comment": "{{ticket.comments[0].body}}",
"author": "{{ticket.comments[0].author_id}}",
}
1
7
7 comments
Zach Anthony
Hey Kyle,
I believe the reason this isn't working for you is that ticket.comment.body and ticket.comment.author_id are not available placeholder properties.
If you would like the ID, Comment and Comment Author for the most recent comment I would recommend trying this in your trigger:
This article has a full list of placeholder properties available for future reference
Hope this helps!
2
Stefan Dao
Hey Zach,
I don't suppose when the webhook triggers, there's a way to see which fields on my Ticket have changed?
0
Zach Anthony
Hey Kyle,
At this stage this is not something that can be easily supported out of the box, however we are exploring being able invoke webhooks based on events occurring in your Zendesk account (such as a ticket field being updated). The only thing that I can suggest is that you include the fields you are interested in, in your payload and do the comparison on your server side with the values from previous ticket updates.
0
Stefano Mini
I have a related problem.
Based on the context of this ticket, I assume it's possible to set up a webhook to get notified of every comment of every ticket.
However, I don't see anything in the documentation for how to do that. Can anyone link to the appropriate resource please? I'm really stuck here.
0
Christophe A.
To be notified for every comment of every ticket, the best option is to:
If you need more information about how to connect webhooks to triggers, I recommend this article section: Connecting to triggers or automations
Hope it helps a bit :-)
0
Sebastian Olszewski
Hello, is there a way to notify active webhook ONLY when new comment is added? Your provided solution is not fully correct as we will be notified every time when ticket is updated, not only when new comment is added. Also latest comment is sent avery time ticket is updated. I need a solution to trigger webhook only when new public comment is added. Is that achievable?
0
Mario Alejandro Rodríguez
Hi Sebastian Olszewski, You can notify the active webhook only when a new comment is added in a ticket using the “Ticket > comment” “is” “Present (public or private)” condition in the respective trigger:
0