There may be situations where a ticket already exists in Zendesk but was not created as part of a task list or subticket workflow. This can happen when tickets are created through the Zendesk API or other automated processes.
In these cases you can link an existing ticket to a parent task in the SweetHawk Tasks and Subtickets app by creating a Zendesk trigger.
| When the Tasks app is installed it creates a system trigger named App - Tasks and Subtickets - Link parent task. This trigger is used internally by the app and should not be modified or deleted as part of this process. |
The steps below creates a new trigger that also uses the same webhook, which is completely safe and supported.
Create a new Zendesk trigger
For this workflow, you will need to send in a trigger the parent ticket ID and a name for the task on the parent ticket. The parent ticket ID must be stored in the field used by the Tasks and Subtickets app named 'Parent ticket id'.
- Go to Admin Center
- Open Objects and rules
- Select Triggers
- Click Add trigger
Trigger Conditions
In Meet all of the following conditions, add at least the following:
- Parent ticket id - Is - Present
- Tags - Contains - add_subticket
A tag condition is important here so that the trigger only runs when you want to attach the ticket and not just when the Parent ticket id is present.
Trigger Actions
In the Actions section add:
- Remove tags: add_subticket
- Notify by: Active webhook and then select the webhook: App - Tasks and Subtickets - Link parent task.
In the parameter section of this webhook, define:
- Key: new_task_name
- Value: A name for the subticket
For the subticket name, you can use a static name, or use dynamic Zendesk placeholders such as: {{ticket.title}} {{ticket.id}} etc.
Save the trigger.
Add the Parent Ticket ID to the ticket
Once the trigger is ready, the only step left is to update the existing ticket so that the Parent ticket id field contains the correct parent ID you want to attach this subticket to.
Note: The Parent ticket id field is always hidden by the Tasks and Subticket app on all forms so agents cannot modify this field directly within Zendesk.
As soon as this value is added, the trigger will fire and the ticket will be linked as a subticket.
Ways to update the Parent ticket id
- Through the Zendesk API
- Using the SweetHawk Power Actions app
Summary
- Create a trigger that runs when Parent ticket id is present.
- Add a webhook action using App - Tasks and Subtickets - Link parent task.
- Include the required parameter new_task_name.
- Update the ticket so the Parent ticket id field has a value.
- The ticket becomes a subticket of the parent task.