Do stuff in a parent ticket based on sub-ticket actions (advanced)

In this article, you'll learn how to change things in a parent ticket base on actions taken in a sub-ticket. 

For example, let's say you wanted to post every comment that was made by an agent in a sub-ticket back to the parent ticket as a private comment.

There are 3 steps to make this happen.

Step 1: Create a target

Step 2: Get ID for "Parent Ticket ID"

Step 3: Create a trigger



Step 1: Creating the target

To create a target click on the admin cog on the left of the screen and right down the bottom go into extensions. Then click on "Add target" at the top right-hand side.


Next, choose HTTP target



Then give the target a name eg. "Update many" 

For the URL enter:

Important: Make sure you replace yourhelpdesk with your Zendesk URL ;-)
Also important: Make sure to not alter the URL in any other way.

Set the method to "PUT, content type to "JSON", and lastly check to enable basic authentication and enter your Zendesk user credentials. 

The target should now look something like this:


Finally, click submit to CREATE the target. 


Step 2: Get the ID for the parent ticket field.

In order to change the parent ticket, we'll need to reference the ID of it in the trigger. So, you'll need to search for it. You can do this by going to this URL:

(Replace yourhelpdesk with the name of your help desk)'

Then do a search (ctrl + f) for the "Parent Ticket ID" ticket field and make a note the ID like this: 


You may see the information above displayed a little differently, but all you need is the ID so once you find it, make a note and head back to the agent interface. 


Step 3: Creating the trigger

Ok you're almost there. To create a trigger simply click on Triggers in your admin, and at the top right click on 'add trigger' like this:


Then name your trigger something like "Update parent task"

Next under "Meet all of the following conditions" set the rules when you want the trigger to fire. For example, you may want it to only fire on tickets with an actual parent ticket, so you could add the rule:

"Parent Ticket ID" - "Present" 

You may only want to update the parent ticket when the sub-ticket is updated by the agent so you would add the rule:

"Current user" - "Is" - "Agent"

Finally based on the example we used at the start if you're wanting to update the parent ticket with a comment made on the sub-ticket, you'll probably want to check that one has actually been made with this rule:

"Comment" - "Is" - "Present (public or private)"

So your trigger rules might look something like this:


Finally under "ACTIONS" is where you set the rule to notify the target you created in step 1. 

You will need to add the rule:


"Notify target" - "Update many" 


Then the JSON body section is where you define what you want to happen. 

Since we'll be wanting to update the parent ticket we need to specify it by referencing the ticket field ID we collected in step 2. 

Your code might look something like this: 

  "tickets": [
    "id": "{{ticket.ticket_field_81189308}}"

Where 81189308 should be replaced with your ticket field ID. 

Once you've added in that code, you can start adding other rules to do stuff to the parent ticket. For example, if you wanted to change the status to open it would look like this: 

  "tickets": [
    "id": "{{ticket.ticket_field_81189308}}",
    "status": "open"

You can actually do anything you like to the parent ticket, and the full API documentation can be found on the Zendesk KB here: 

For our example, we're wanting to post a private comment on the parent ticket of what was said on the sub-ticket, so the JSON will look like this:

  "tickets": [
    "id": "{{ticket.ticket_field_81189308}}",
    "status": "open",
    "comment": { "body": "Comment from subticket: {{}} - {{ticket.latest_comment}}", "public": false }


Once you're happy with what you're doing to the parent ticket, simply click to 'create' the trigger at the bottom right.

Sweet! You're now ready to test out your new workflow. 

Just create a ticket, then create a sub-ticket and do something to the sub-ticket which will match the conditions of the trigger above.



Have more questions? Submit a request


  • 1

    This has worked perfectly and absolutely improves our workflow. 

    Thank you Peter.

    Top Tip: When getting the ID in Step 2 if you use Firefox to browse to the URL instead of Chrome, it'll display in a more user-friendly format.


  • 0

    Thanks for the tip Craig! ... yes, I think for Chrome I had to install this plugin to make it look nice.

  • 0

    Not real useful if you have MFA turned on for all accounts.

  • 0

    Hi Hugh, if you have MFA (Multi-Factor Authentication) turned on, when setting up your target, you'll need to use a token instead of the normal username and password. 

    To create a token goto 'Channels' -> 'API' and click to add one. Once created, copy it somewhere safe because you'll never have access to it again. 

    Then, over in the target, for password, paste in your token. 

    ...and for username, put in your email address with a /token after it like this.

    If you have any troubles getting it going shoot an email through to :-)

  • 0

    Hey Peter,


    Is there any way to have this update check off a task in the parent ticket? I've tried adding the tag associated to the task I want to mark complete as part of the update, but it doesn't seem to change the task state on the parent.



  • 0

    Hi Dan, the only task in a parent ticket that you're able to check off within the sub-ticket is it's own task (ie. the task linked to the sub-ticket) which is done by marking the sub-ticket as 'solved'. 

    So, while you can do just about anything else to the parent ticket, checking other tasks is unfortunately not currently possible.

  • 0

    Hi Peter, 

    Is there a way to only have parent tickets assigned to certain groups open instead of all groups in Zendesk?

    Thank you, 

Please sign in to leave a comment.
Powered by Zendesk