Support Tip: How to change the ticket Subject using a trigger



已于 2019年10月14日 发布

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.


0

50

50 条评论

Alguém do zendesk consegue me ajudar a implementar isso? Estou tendo dificuldades.

0


Hi 5043840110874 , I just tested the webhook and trigger as described, everything seems to work fine. Can you see if the webhook failed for some reason? Feel free to share a screenshot of the webhook's JSON body in the trigger.

0


Does anyone have the same problem as me? The trigger is simply executed, however the subject field is not changed.

0


My Zen-Friends, 7445642750362  6459866716570  1265038659329 

 

I figured it out!

To get the actual field value to populates instead of the tag, use the placeholder: {{ticket.ticket_field_option_title_fieldidhere}}.

Was going through some Zendesk documentation and saw it, figured it was worth a shot and much to my surprise it WORKED!! >:) 

 

0


5174506379034 This is a silly way to fix your problem_with_tickets_like_this

But there are invisible space characters you can use in your tickets ( ᅠ) < I copy and pasted it into here. Incase  it gets filtered out for some reason you can google “invisible space character” to find it 

Simply edit all of your tags to reflect this

0


6459866716570 happy to help! Glad it worked. :)

0


Amazing - that did it, thanks so much 5174506379034!

1


6459866716570

the placeholder would be {{ticket.ticket_field_22563332159121}}. So the code would be:

 

{"ticket": {"subject": "STAC - Onboarding -  {{ticket.ticket_field_22563332159121}}"}}

 

 

1


Hi folks,

Am working on changing the subject line to the following but my custom field is not appearing (only the STAC - Onboarding part)

{
"ticket": {
"subject": "STAC - Onboarding - {{ticket.customField:custom_field_22563332159121}}"
}
}

I presume I'm referencing the custom field incorrectly?

0


Hi Hannah,
 
This is expected if you are using the placeholder of a custom field associated with a tag. More information about custom fields is here. The placeholder will only render the exact same text if it is a multi-line or text field. 
 
In addition, the workflow of updating a ticket via a webhook trigger is not recommended due to errors that are likely to happen. You may find more information here for reference: Can I use a trigger and a webhook to update tickets?
 
Best,
Paolo | Technical Support Engineer | Zendesk

0


登录再写评论。

找不到所需的内容?

新建帖子