Update text field in triggers
回答済みHi,
Is there a way you can use a trigger to update a text field on a ticket, as it seems this is limited to things like drop down fields only.
Thanks,
Tim
-
Hey Tim,
If I'm understanding you correctly, you could potentially use a webhook to update a ticket field. I'd recommend taking a look at the following article which goes over creating webhooks and how to use them within triggers: Creating webhooks in Admin Center
I hope this points you in the right direction!
-
Hi Tim Bradgate!
Not natively, but you can use the API in conjunction with a Webhook and Trigger to make these updates. See below:
1. Create a Webhook target with the following information:
- Go to Admin Center from Zendesk Products -> Admin Center
- In Admin Center, select Apps and Integrations -> Webhooks
- Provide the following:
- -- Name for your Webhook
- -- Endpoint URL: https://subdomain.zendesk.com/api/v2/tickets/{{ticket.id}}.json
- -- Request Method: PUT
- -- Request Format: JSON
- -- Authentication: Basic authentication
- -- Username: email@domain.com/token
- -- Password: Your API token
2. Create a trigger that notifies the webhook
- Set up a trigger as normal, something like Ticket = Created and Form = XYZ (or whatever values make your trigger true)
- Under Add Actions, select Notify Active Webhook
- Select your newly created webhook
- Under JSON body, use the following template:
{
"ticket": {
"custom_fields": { "field_id_to_update": "value" }
}
}In the above, update field_id_to_update with the custom field ID, and the value with whatever you want the text field to be!
-
What they said. You can update just about any field that way. We use a trigger to update the subject using a webhook and JSON.
{"ticket": {"subject": "{{ticket.title}} [{{ticket.ticket_field_360042229672}}]"}}
This is the webhook:
-
The above suggestions work, but you need to be careful with your conditions. Also see https://support.zendesk.com/hc/en-us/articles/4408882855578-Can-I-use-a-trigger-and-a-webhook-to-update-tickets-
-
I'm having trouble getting this to work. I get a 200 OK on the webhook, so it's not an error with the webhook itself, but the field is just not updating in the ticket.
I'm looking to get the value of a lookup field to update a text field.
My JSON payload is (same if I use {{ticket.ticket_field_18864920793879}}):
{
"ticket": {
"id": 9141268150423, "value": "{{ticket.ticket_field_option_title_18864920793879}}"
}
}Where 9141268150423 is my text field, 18864920793879 is the lookup field. Does this not work with look-up fields?
-
Hi Carmelo!
I created a ticket for you, I'll assist you there!
サインインしてコメントを残してください。
6 コメント