Question
How do I pass custom ticket values to a trigger?
Answer
It is possible to pass custom ticket field values in a trigger. This is particularly useful when you have to communicate the values to a target.
The syntax is composed by a key-value pair, a string for the field name, and the field_id, as in he example:
"myCustomFieldName: "{{ticket.ticket_field_<field ID number>}}"
For more information about ticket fields, see About ticket fields.
8 Comments
I tried this on a trigger that emails the admins of a ticket created. We came up with a way to "Temp Assigned" and keep the case new until the agent works the case. So, I created a custom Field for 'Temp Assigned" and put each agents name in there. However, when I put the custom field info into a trigger email, it does not include the field at all. I put in the same as what you have as the sample but replaced the field ID with what the Field ID i see in our system, but it still doesn't go.
Hey Kyle,
Any chance you could provide a screenshot of the trigger you've set up so I can take a look for you? Additionally, if this email is sent to an end-user, you'll want to make sure the ticket field is visible and editable to end-users by navigating to Admin>Manage>Ticket Fields.
Hope to hear from you soon!
Hi Brett,
Here is what I have. and yes, the ticket field is editible by the agents. Does it have to be editing/visible for the end-user, not just the agents?
Brett Bowser Kyle Davis Were you able to get this to work? I am testing the same scenario, have created a "testField" and have set exactly what's specified in this article and am unable to get the information to populate.
Further, would this extend to ticket.requestor custom fields as well? Is that possible
Hi, Ed McGough
I so far have not been able to get it to work. I have changed the formatting and a few other things and it will not pass the value over
Hey Ed,
Who are you trying to display this field value to? For end-users, you'd need to make sure the field is visible and editable to end-users for it to display in the email notification.
Any chance you could also provide a screenshot of the trigger you referenced?
Hey Kyle,
I'm going to create a ticket on your behalf so our Customer Advocacy team can look into this for you.
You'll receive an email shortly stating your ticket has been created.
Cheers!
Brett Bowser see below
And the associated Trigger calling the field.
Also, is it possible to grab custom fields from ticket.requestor...maybe {ticket.requester.custom_fields_{field_id}}
Please sign in to leave a comment.