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 👍
Please sign in to leave a comment.
37 Comments