You may find the need to update the child ticket when a custom field on the parent ticket is updated. For example, the requester of the parent ticket makes an update that needs to be passed down to all of the child tickets that have already been generated.
To set this up, we'll need to use the update-child-tickets action of our webhook and a trigger.
With update-child-tickets action, you can update any data on the child tickets - comments, status, custom fields, or anything else!
To set up the trigger that updates the comments, navigate to the Admin Center > Objects and rules > Triggers > Add new trigger:
Conditions:
- Ticket is - Updated
- Since this trigger is usually used to copy down all of the changes made to the parent ticket, usually the only other condition needed is that it contains one of the tags that indicates that the ticket is a parent ticket (for the list of tags, please click here)
Actions:
- Notify active webhook - MPM Webhook
- JSON Body:
{
"action": "update-child-tickets",
"data": {
"ticket": {
"custom_fields": [
{
"id": 27642,
"value": "745"
},
{
"id": 27648,
"value": "yes"
}
]
}
}
Few things to note:
- 27642 and 27642 above are the custom field ID of the field that will be updated on the parent ticket. This can be found by going to Zendesk Admin Center > Object and Rules > Fields and finding the field in the table
- The value "745" is the value that the parent field will receive. This can be replaced with anything you'd like or nothing at all if you want to clear out the field:
- If you'd like to empty the field, the line would be entered like so:
"custom_fields": [{ "id": 27642, "value": "" }] - If you would like the child ticket to inherit the value that is on the parent ticket, use the Zendesk's native placeholder:
"custom_fields": [{ "id": 27642, "value": "{{ticket.ticket_field_27642}}" }] - This target uses the same structure that is used in Zendesk's ticket API, so you can use this target to update any of the ticket properties (like comments, assignee, etc.). For more info, click here.