If you cascade custom fields (automatically copy custom fields to children tickets) enabled in Myndbend's App Settings, you may need to overwrite a certain field in the child ticket upon creation. To set this up, we'll need a target and a trigger:
Target Configuration
Settings > Extensions > Add Target > Create HTTP Target
Title: "MPM Overwrite custom field on child ticket"
URL: https://youraccount.zendesk.com/api/v2/tickets/{{ticket.id}}.json
Replace "youraccount" with your actual Zendesk subdomain.
Method: Put
Content Type: JSON
Basic Authentication: Enabled (checked)
Username: admin@domain.com/token (this is your Zendesk admin email followed by /token)
Password: Your Zendesk API Key (API > Add New Token)
Trigger Configuration
Settings > Triggers > Add Trigger
Conditions:
Ticket is... Created
Tags contains... at least one of the following... mpm_child_ticket
Under Actions, select/enter the following:
Notifications: Notify target
Target: "MPM Overwrite custom field on child ticket"
JSON Body:
{
"ticket": {
"custom_fields": { "1234567": "Something"}
}
}
Couple things to note:
- 1234567 above is the custom field ID found by going to Zendesk Settings > Ticket Fields > Select the custom field and find the ID at the top.
- The value "Something" 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": { "1234567": ""}.
- You could enter the parent ticket's ID (stored in child ticket's external_id) into a custom field for use in views, like so: "custom_fields": { "1234567": "{{ticket.external_id|remove:'child_of_'}}"}
The child ticket custom field will now will be overwritten every time a child ticket is created.
Feel free to change the trigger conditions and JSON body to match your display requirements.