Support Tip: How to change the ticket Subject using a trigger
Note: comments added before August 2022 referred to the previous version of this article, when this could be achieved using targets/extensions (which were replaced with webhooks).
The "Email user" action allows us to set the subject/title of the email notification to the requester. The ticket Subject doesn't change, however.
Although there isn't a straightforward trigger action to modify the ticket Subject, we do have a way to achieve this with a Notify active webhook action.
Here's how to do it:
1. Create a webhook to update tickets
Go to Admin Center » Apps and Integrations » Webhooks and create a new webhook (under Actions, on the top-right corner).
Complete the required webhook fields:
- Name. The name of your webhook (e.g. "Update Ticket")
- Endpoint URL: https://yoursubdomain.zendesk.com/api/v2/tickets/{{ticket.id}}.json (make sure to replace 'yoursubdomain' with your own subdomain)
- Request method: PUT
- Request format: JSON
- Complete the Authentication method (use an administrator's credentials)
2. Add webhook action to your trigger
Edit the trigger you want to modify the ticket Subject.
Under Actions, add a Notify active webhook action.
Input the following in the JSON body part of the trigger action:
{"ticket": {"subject": "Your new subject is here!"}}
Example:
That's it! Now you have a trigger action that updates the Ticket Subject.
-
Pedro Rodrigues (opservator.com) thank you for the reply. I checked and the webhook is active.
Request methodPUT
Request formatJSONI am an admin but it does say "basic authentication" not sure if that's a problem. -
Hi folks,
Thanks for this info! Question for you - I'm using this to set the subject of our tickets upon creation with the data from a specific field. The trigger seems to successfully update the ticket subject on the agent side, but when I look in the help center, and the email notifications, I still see the old subject. Do you know how I can get the subject to change in the help center and email notifications?
-
We have a custom form on our website that submits data into a ticket via email but it adds a string of text to the subject (and thus ticket subject) that we do not want in there.
Is there a way to adapt this to remove a specific string of text from the ticket subject and leave the rest of the subject as is?
-
Hello Juan,
Natively this unfortunately not possible.
But I have found the following Community Post with a workaround for it:
Support Tip: How to change the ticket Subject using a trigger
-
Hello, how can I add the Ticket ID to a custom ticket field?
-
+1 for just being able to do this as a trigger.
Additionally, it looks like the layout for webhooks has changed since this article was created and it could use a refresh to match what's current in the UI.
-
Hi Anna Billings, you're right - article updated accordingly! Thank you for the heads up 👍
-
Hi Friends!
I have a webhook that changes the subject of the ticket to be the custom field value chosen for the ticket topic. The problem with this is it displays more like a ticket tag than a readable subject. We use nested values (example::of::topics) that show as (example__of__topics).
How can we get it to not display the __? Instead show example of topics if using the case study above? -
Hannah Lucid, I have a similar issue. Though the team doesn't complain about the underscores, it bothers me, lol. The system pulls in the tags of the fields. So to bypass this, you'd have to change the tags - which is limited itself as you can't use spaces. Also, if you change the tags after the field has been in use, it can mess with historical data and reporting.
-
Teresa not to be dramatic but UGH. I was hoping for spaces instead of underscores. I also noticed that the fields populate in monday.com JUST LIKE THIS but Zendesk states it's a monday.com integration challenge on their end. I'm suspecting that data pulled from text box fields populate as tags in general. :( Unless someone has a REALLY creative idea to assist with this subject line issue specifically :D
Please sign in to leave a comment.
40 Comments