Automatically adding deadlines to tickets

Using Zendesk triggers, you're already able to set a deadline on a ticket X number of days in the future. However, one of the limitations of Zendesk triggers is that you're not able to update custom text fields. Since the deadline date and timezone are text fields, that means this is not possible to automatically set the time of the deadline right? Well no. It's not as easy as it could be, but it is still possible. 

STEP 1: The target

The first step is to setup a http target. To do this first click on the cog on the left of the screen, then scroll to the bottom and click on "Extensions". Then at the top right click on "add target" like this:

Name it "Update ticket". 

For the URL add in this: https://yourhelpdesk.zendesk.com/api/v2/tickets/{{ticket.id}}.json

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

Set the method to "PUT"

...and the content type to "JSON"

Finally, tick the box to enable credentials and enter in your Zendesk credentials... it should look like this when you're done: 

Once you're happy go ahead and create the target.

 

STEP 2: Getting the ticket field ID's

In order to set the ticket fields in the trigger we're going to need the ticket field ID's. However, since they've been created by the app you're not able to access those screens the normal way. So we'll need to search for them. You can do this by going to this URL:

https://yourhelpdesk.zendesk.com/api/v2/ticket_fields.json

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

Then do a search (ctrl + f) for the deadline ticket fields and make a note the Deadline time ID and the Deadline timezone ID. 

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

 

STEP 3: Creating the trigger

To create the trigger that will automatically add the due date in the future click on the cog on the left of the screen, then click on triggers, finally click on 'add trigger' at the top right-hand side like this: 

Under "Meet all of the following conditions" you can put in whatever rules are required for the workflow you're trying to achieve. 

Under "Perform these actions" add the rules:

# "Ticket: Deadline Date" - "Set to a number of days from now" - "[Enter the number of days you want]"

# "Notifications: Notify target" - "Update ticket" 

In the JSON body add this code: 

{
"ticket": {
"custom_fields": [{"id": 49021128, "value":"9:00 AM"},{"id": 49021148, "value":"Melbourne"}]
}
}

Replace the ID's listed above with the ID's you noted in step 2. Also set the value "Melbourne" to your timezone.

When you're done it should look something like like this: 

Finally, click on "Create trigger" at the bottom right-hand side and test it out. 

 

 

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk