How to push information from the parent ticket into subtickets (advanced).

Here you'll learn about a method you can use with our Zendesk Tasks app that allows you to quickly share information from a parent ticket into all of its subtickets. 

You can do this by following these steps. 

1. Create a Zendesk text field where the list of subticket IDs will be stored. 

2. Change your settings in the Tasks app to feed the sub ticket ids into your new field.

3. Create a Zendesk checkbox field allowing agents to manually trigger the sending of data.

4. Create a webhook that sends the data to the right tickets. 

5. Create a trigger that specifies what data you want to send.

 

1. Create a Zendesk text field that will store a list of the subticket IDs. 

To do this go into Zendesk Admin Center and then in Ticket Fields, click on Add field at the top right of the screen. 

Then select the Text option and give the field the name "Ticket IDs to be sent data" and click on Save at the bottom like this:

SweetHawk__-_Agent.jpg

Now do a search of your existing ticket fields for the one you just created. Copy the field ID into your notes. The reason for doing this is because you will need this ID later in another step.

 

SweetHawk__-_Agent.jpg

Note: Based on the configuration of your Zendesk account, you may now need to add it to the forms you want to use this on. 

 

2: Set the tasks app to feed a list of subticket IDs into your new field.

To do this, click into Tasks in the main icon on the left of the screen. Then under Settings click + and add the Task status changed event. Next add the field Ticket IDs to be sent data and paste in the following liquid markup:

{{ ticket.tasks | where: "has_subticket" | map: "subticket_id" | join: ", " }}

Like this: 

sweethawk_–_Zendesk.jpg

 

Step 3: Create a checkbox field to set when you want data to be sent.

Now, back in Zendesk Admin Center, under Ticket Fields, click on Add field at the top right. 

Then select the Checkbox option and give the field the name "Send data to ticket" and click on Save at the bottom like this:

SweetHawk__-_Agent.jpg

Note: Based on the configuration of your Zendesk account, you may now need to add it to the forms you want to use this on. 

 

Step 4: Create a webhook to send the data to the right tickets.

To create a webhook, first, at the top right of the screen click to go into the Admin Center like this: 

SweetHawk__-_Agent.jpg

Then in the Webhooks section, at the top right, under Actions, select Create Webhook like this: 

Screen_Shot_2021-10-07_at_11_22_45_am.jpg

 

Then a) give it the name "Update many (from ticket field)" and b) in the Endpoint URL section place in this URL:

https://myzendeskdomain.zendesk.com/api/v2/tickets/update_many.json?ids={{ticket.ticket_field_900012010626}}

Where "myzendeskdomain" is the name of your Zendesk instance, and "900012010626" is the ID of the ticket field that you copied from Step 1. 

c) Now set the Request method to PUT.

d) Request format should be JSON

e) Set Authentication to Basic authentication.

f) Put in your username and password for Zendesk. 

 

Note: If you're using SSO on your desk, you will not be able to use your regular username and password. Instead, you will need to enter your username with /token at the end like this: peter@sweethawk.com/token and for the password, you will need to generate an API token - see here for more.

Finally, click on Create at the bottom like this:

Zendesk_Admin_Center.jpg

 

Step 5: Create trigger to specify what data you want to send. 

To create a Zendesk trigger, in the Zendesk Admin Center go into Triggers, then on Add Trigger at the top right.

Now give it the name like "Pass data to sub-tickets" and under Meet ALL of the following conditions add the rules... 

Ticket - Is - Updated

Send data to tickets - Is - Checked

...like this:

SweetHawk__-_Agent.jpg

Then under Actions set the rules...

Send data to tickets - Unchecked

Notify active webhook - Update many (from ticket field)

Inside the JSON body you can insert the code: 

{
"ticket": {
"comment": { "body": "Comment from parent: {{ticket.id}} - {{ticket.latest_comment}}", "public": true }
}
}

This will simply push through the last comment made on the parent. However, you can send through whatever information you like such as custom field data, assignee, priority etc. For more ideas, have a look at the examples in this article

Now click on Create at the bottom. 

 

Test it out!

Finally, you can test that this works by creating a ticket, then in the Zendesk Tasks app create a few subtickets, then wait for the field named Ticket IDs to be sent data to be automatically populated with the list of ticket IDs.

Finally, add a comment to the ticket, check the box called "Send data to ticket" and click to Submit at the bottom right of the ticket to see what happens in the subtickets.

 


Was this article helpful?
1 out of 2 found this helpful