Question
Can I configure a trigger to auto-comment a ticket?
Answer
No, it's not natively possible to have a trigger add a comment to a ticket. Triggers can send notifications to users containing information from the ticket, but they cannot add a comment to a ticket when they fire.
Important: Zendesk doesn't support using webhooks for Zendesk APIs as a workaround to automatically add comments to tickets. Doing so can result in race conditions and other conflicts. For more details, see the article: Can I use a trigger and a webhook to update tickets?
84 Comments
It is really surprising that this functionality doesn't exist. Just curious, for those who are using a target/trigger combo to have an internal ticket created - are you able to share a step by step guide on how you're doing this? I a looking into whatever ways I can get an internal note added that displays the text used on emails to requester we send out via trigger.
This user tips and tricks explains the comment part farther down in the article:
https://support.zendesk.com/hc/en-us/community/posts/4409515208346-Automated-follow-up-comments-for-Pending-tickets-public-or-internal-
I use it VERY often and it works great.
It is very disappointing to see, that this functionality not only hasn´t been natively within Zendesk, but to see how many people are requesting it, and no change is being made.
there is indeed a method from Zendesk itself to insert public comments in tickets via trigger, they even posted here in the answers 90% of what needs to be done for this comment to be public.
but yes, it is possible to insert public comments in the ticket using triggers.
and has nothing to do with URL, we achieve such action using target notification.
The issue is that using a trigger to do this is not entirely reliable – it's possible that race conditions could result in the ticket not being updated with the comment, or in the comment trigger preventing a different trigger from completing its operation, and there isn't any way to predict if or when that might happen.
Hi Dave, how´s life?
but on what aspect would it not update? We have triggers working this way, inserting public comments into tickets, without any harm to the flow.
it's a native solution of yours, I don't understand how you still haven't noticed.
often the solution to very complex problems lies in absurdly simple solutions. Have you ever heard about it?
Is it possible to use standard HTML formatting with notify targeting?
ie. if I wanted the response to contain a hyperlink
Does anyone know of a way to get this working for a Whatsapp ticket that is on messaging to message the customer?
This can be achievable, but we do not recommend this! The reason is addressed in the following article with more details (Webhooks use the same concept as HTML/Targets): https://support.zendesk.com/hc/en-us/articles/4408882855578-Can-I-use-a-trigger-and-a-webhook-to-update-tickets-
Thanks for your comprehension!
This really would be so useful in so many different usecases!
+1 We need this ability. In general, we need more specific features to have mirrored functionality. If it can be done in a macro, it should be be possible to do it in a trigger, or automation, and so on and so forth (without the need to get involved in URL targets, business rules, etc.).
Lou
Do internal comments from triggers always post as the Zendesk user who created the trigger? Is there a way to change that user? We have a working api call to post an internal comment but I can't seem to find anything tying it to the person it's posting as. That person is no longer with us so we are trying to update. Thanks.
Dylan Walker
The comment will post as whoever's authentication is used for the trigger. All of mine are set up with my credentials, so they always show up as my comments. It's always fun trying to explain to the VP that I didn't do that LOL
Lou
Forgive me but where do you see the authentication in trigger settings? I see it in targets but it looks like we moved everything over to webhooks. I tried recreating the trigger when signed in to my account but it still ended up posting as that old user. Really appreciate the guidance.
Dylan Walker
The authentication is at the target/webhook level. I use my login credentials for authentication. That's why the various actions show up as having been performed by me.
+1 we need this option!
How we would like to use it:
When we put a ticket to status 'pending' we will use automation to send a reminder to the client. but after X times we would like the automation to 'solve' the ticket AND add the comment that we solved it because we tried to reach out for several times but failed to get their attention.
Now the tickets will be 'solved' without a comment.
+1 for such a feature
We do use an API target to send messages to customers using triggers - which works pretty fine in general. The main issue is, that this trigger fires not a message but a dynamic content - we have this message in 6 languages. And no matter which language the customer has, it's always send in EN (default language).
Due to ZD support this can't be changed - therefore using an API target does not work :-( Anyone having an idea how to solve that? I'm not a fan of using "email user" action as I can't see this mail in the ticket and for the customer it's send as seperate mail and not in the ticket thread.
Any input would be appreciated - and of course especially if ZD can implement this feature ;)
Hey all. This is totally doable, though you have to do it through API.
First, set up a webhook. Select PUT. There are two URLs you can use.
Option 1:
https://[domain].zendesk.com/api/v2/tickets/update_many.json
or
Option 2:
https://[domain].zendesk.com/api/v2/tickets/{{ticket.id}}
Then, set up your Trigger. Add an Action to "Notify Active Webhook". Then depending on the URL you used, use one of the following JSON Bodies:
Option 1:
{
"tickets": [
{
"id": "{{ticket.id}}",
"status": "open",
"comment": { "body": "[type your comment here]", "public": false }
}
]
}
OR
Option 2:
{
"ticket": {
"comment": { "body": "[type your comment here]", "public": false }
}
}
It's pretty lame Zendesk doesn't have a built in Action for this, but I use the two methods above a bunch and it works great. There are lots of articles that cover how to set up a webhook and your API token, so I won't repeat it here.
Notes: Option 1 is great if you want one ticket to send a comment to one or more other tickets. You can replace "{{ticket.id}}" in the JSON body with a placeholder for a field in your ticket that lists a ticket number (for example, if you are targeting a Parent ticket and you have a parent ticket ID field). If you want to target multiple tickets, the field should list all of the ticket numbers, separated by a comma.
Option 2 is the most straight forward if you want an action to trigger a comment being placed in the same ticket. Using the target "https://[domain].zendesk.com/api/v2/tickets/{{ticket.id}}" is literally just pointing back to the same ticket that tripped the trigger.
Replace "public": false with "public": true if you want this comment to be Public and sent to the Requester.
In your body, you can also use placeholders if you want to grab information from fields in the ticket.
There are lots of formatting options you can reference, such as surrounding text on both sides with ** will make it bold, or using \n will create a new line, etc.
I hope this helps!
Thanks to Lou and everyone else who has contributed here. Someone (sorry I've lost track now after reading the whole thread) indicated that we need to be very careful to only trigger this ONCE. Well, mine is firing multiple times and I don't know how to change that. Can anyone point me in the right direction?
Marci Abraham
You can add an action in the trigger that adds a specific tag such as {trigger_name}_executed.
And then have a condition in the trigger for tags that contain none of the following: {trigger_name}_executed.
This should prevent the trigger from running more than once.
Thanks so much Walter!
This is a significant shortcoming for our team.
Looking into the scenario, the example way to do this would be through a script that would run a GET on the ticket_fields end-point, which would run a check to see if the ticket field is 1) present on the ticket and if so, 2) return the value of that ticket. Next, you would want to create a POST with this portion of the tickets end-point to add that data to the ticket comment.
If you don't have your own developers, you can consult our Professional Services team or you can contact and get services from one of our partners online here: https://www.zendesk.com/marketplace/partners/ for any custom development or apps that they can build outside the native features. Thank you!
Hello All,
We finalising the automations for Zendesk inside Proactive Campaigns app.
The new feature will help you setting up follow-upі and other automated emails right from you Zendesk.
Email campaigns + transactional emails in one place - your Zendesk.
Stay tuned!
Please sign in to leave a comment.