Automatic ticket creation for task list item (beta)

To have a task automatically create a ticket when it's added to the ticket, first you will need to turn this feature on by clicking on the tasks admin icon on the left of the screen. Then switch it on under 'settings' like this:

SweetHawk__-_Agent.png

Next... to define the details of the ticket you want to create, under the 'Task lists' tab, go into the desired list, then click the 'edit' button next to the task you want.

SweetHawk__-_Agent_2.png

Finally, in the popup screen, in the 'ticket data' section, you will need to provide some JSON that defines the details of the ticket to be created like this:

SweetHawk__-_Agent_3.png

To have a ticket automatically created, you can start by defining a minimal JSON structure in the Ticket data field:

{}

This will create a ticket with default values: the subject will be set to the task list item's name, the description will be just '.' and created as Internal Note.

If you'd like to set other fields, this can be done like this:

{
  "subject": "Printer fire",
  "priority": "high",
  "comment": {
    "body": "Some smoke is coming out!",
    "public": true
  }
}

You can use liquid markup inside the values to copy values from the parent ticket:

{
  "requester_id": "{{ticket.requester.id}}",
  "comment": {
    "body": "Get back to {{ticket.requester.email}} regarding {{ticket.subject}}",
    "public": false
  }
}

You can set custom fields like this:

{
  "subject": "Printer fire",
  "custom_fields": [
    { "id": 12345678, "value": "custom_field_value" },
    { "id": 12345679, "value": "Here's a value" }
  ]
}

Because the JSON used is identical to the format Zendesk uses to create tickets, more information about the fields you can use can be found in Zendesk's API documentation.

 

Have more questions? Submit a request

2 Comments

  • 0
    Avatar

    How i can create newline in comments body?

    something like: "body": "Get back to {{ticket.requester.email}} <br/> regarding {{ticket.subject}}"

     

  • 0
    Avatar

    For newlines, please use "\n" (backslash N) so in your example: "body": "Get back to {{ticket.requester.email}}\nregarding {{ticket.subject}}"

Please sign in to leave a comment.
Powered by Zendesk