You may find the need to update the parent ticket when a custom field on the child ticket is updated. For example, the assignee of a child ticket collects info that should be updated on the parent ticket without manual intervention. This could also be useful if you automatically copy custom fields to child tickets upon creation (enabled in Myndbend's App Settings) and want that updated parent field to make its way into new tickets. To set this up, we'll need to use the update-parent-ticket action of our webhook and a trigger.
With update-parent-ticket action, you can update any data on the parent ticket - comments, status, custom fields, or anything else!
To set up the trigger that updates the parent ticket, navigate to the Admin Center > Objects and rules > Triggers > Add new trigger:
Conditions:
- Ticket is Updated
- Tags contains at least one of the following mpm_child_ticket
- Choose additional conditions to avoid overriding the parent ticket value continuously
Actions:
- Notify active webhook - MPM Webhook
- JSON Body:
{
"action": "update-parent-ticket",
"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 parent to inherit the value that is on the child ticket, use the Zendesk's native placeholder:
"custom_fields": [{ "id": 27642, "value": "{{ticket.ticket_field_27642}}" }]
The parent ticket custom field will now be overwritten every time a child ticket is updated. Keep in mind, this may create a scenario where the field is overwritten too often. Please add additional trigger conditions to ensure this only happens when intended.
Feel free to change the trigger conditions and JSON body to match your display requirements.