Child tickets can inherit all values from the parent ticket if you enabled this option in the settings:
However, you may need to inherit only some of the parent ticket values or set the custom fields to specific values. That's where Advanced Properties of our ticket templates come into the play!
You can find the Advanced Properties at the bottom of the Ticket Template page:
In Advanced Properties, you can define all of the values using the JSON, in the following format:
{
"custom_fields": [
{
"id": number,
"mode": "exact" | "parent_copy" | "parent_placeholder",
"value": null | boolean | number | string | string[] | number[] | "ticket.(<system_field>|ticket_field_<ID>)"
},
{
"id": number,
"mode": "exact" | "parent_copy" | "parent_placeholder",
"value": null | boolean | number | string | string[] | number[] | "ticket.(<system_field>|ticket_field_<ID>)"
}
]
}
Let's break down the options!
ID - Required field. It's expecting the ID of the field which should have its value set. You can find the ID of the field on the Zendesk's Ticket Fields page:
Mode - If mode is not present, it will default to exact. It's expecting one of the following options:
- parent_copy - Copy the value from the parent ticket for this field. The value that this field has on parent ticket, will be set to the field in the child ticket.
- parent_placeholder - Will take the value from the parent ticket field using the placeholders defined in the value. For example, you can take the value from the Field A from the parent and paste that into Field B on child ticket creation.
- exact - Use the value defined as-is.
Value - If mode is parent_placeholder or exact, this field is required. If mode is set to parent_copy, this value will be ignored.
The Value attribute is used to set the value of the field on the child ticket. You can use Zendesk placeholders to inherit values from the parent.
Now that we know how to set a value, the final JSON would look something like this:
{
"custom_fields": [
{
"id": 123,
"mode": "parent_copy",
},
{
"id": 321,
"mode": "exact",
"value": "Child value"
},
{
"id": 432,
"mode": "parent_placeholder",
"value": "ticket.ticket_field_123"
}
]
}