Create a Zendesk Alert Template

Template Name: Zendesk Ticket

Add the following attributes to the Standard Alert Template (Administration -> Templates)

Name: Customer Name

Data Type: short string

Active: true

Name: Customer Email

Data Type: short string

Active: true

Name: Ticket ID

Data Type: short string

Active: true

Create the Outbound Service

Enter the Service Name “Zendesk”.

Web Security Type = Basic

Username = (zendeskuser name * user must have permissions to create and modify tickets)

Password = (zendesk user password)

Add the Create Ticket Method

From the Service Detail screen, click Add Method.

Method Name: Create Ticket
Service Type: REST
Template Type: Zendesk Ticket
URI: https://(yourzendesksubdomain)/api/v2/tickets.json
Content Type: JSON
Web Method: POST
Response Data Type: JSON
Response Action: Update Alert Fields = true

Content Data:

{ “ticket”:  {“requester”:  {“name”: “<<MessageThread.CreatedDate>>”, “email”: “<<Attribute.Customer Email>>”},  “submitter_id”: 22098125687,  “subject”: “<<MessageThread.Topic>>”,  “comment”:  { “body”: “<<Message.MessageText>>” } }}

Response Data:

{  “ticket”: {    “url”: “https://yourzendesksubdomain/api/v2/tickets/2.json”,    “id”: “<<Attribute.Ticket ID>>”,    “external_id”: null,    “via”: {      “channel”: “api”,      “source”: {        “from”: {},        “to”: {},        “rel”: null      }    },    “created_at”: “2017-05-03T16:16:20Z”,    “updated_at”: “2017-05-03T16:16:20Z”,    “type”: null,    “subject”: “My printer is on fire!”,    “raw_subject”: “My printer is on fire!”,    “description”: “The smoke is very colorful.”,    “priority”: null,    “status”: “open”,    “recipient”: null,    “requester_id”: 22104712247,    “submitter_id”: 22098125687,    “assignee_id”: 22098125687,    “organization_id”: null,    “group_id”: 41944047,    “collaborator_ids”: [],    “forum_topic_id”: null,    “problem_id”: null,    “has_incidents”: false,    “is_public”: true,    “due_at”: null,    “tags”: [],    “custom_fields”: [],    “satisfaction_rating”: null,    “sharing_agreement_ids”: [],    “fields”: [],    “brand_id”: 7285807,    “allow_channelback”: false  },  “audit”: {    “id”: 296605396767,    “ticket_id”: 2,    “created_at”: “2017-05-03T16:16:20Z”,    “author_id”: 22098125687,    “via”: {      “channel”: “api”,      “source”: {        “from”: {},        “to”: {},        “rel”: null      }    },    “metadata”: {      “system”: {        “client”: “Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36”,        “ip_address”: “173.167.172.193”,        “location”: “Schaumburg, IL, United States”,        “latitude”: 42.04079999999999,        “longitude”: -88.1084      },      “custom”: {},      “notifications_suppressed_for”: [        22104712247      ]    },    “events”: [      {        “id”: 296605396847,        “type”: “Comment”,        “author_id”: 22098125687,        “body”: “The smoke is very colorful.”,        “html_body”: “<div class=\”zd-comment\”><p dir=\”auto\”>The smoke is very colorful.</p></div>”,        “plain_body”: “The smoke is very colorful.”,        “public”: true,        “attachments”: [],        “audit_id”: 296605396767      },      {        “id”: 296605397367,        “type”: “Create”,        “value”: “22104712247”,        “field_name”: “requester_id”      },      {        “id”: 296605397407,        “type”: “Create”,        “value”: “My printer is on fire!”,        “field_name”: “subject”      },      {        “id”: 296605397447,        “type”: “Create”,        “value”: “open”,        “field_name”: “status”      },      {        “id”: 296605397487,        “type”: “Create”,        “value”: null,        “field_name”: “priority”      },      {        “id”: 296605397527,        “type”: “Create”,        “value”: null,        “field_name”: “type”      },      {        “id”: 296605397547,        “type”: “Create”,        “value”: “22098125687”,        “field_name”: “assignee_id”      },      {        “id”: 296605397587,        “type”: “Create”,        “value”: “41944047”,        “field_name”: “group_id”      },      {        “id”: 296605397627,        “type”: “Notification”,        “via”: {          “channel”: “rule”,          “source”: {            “to”: {},            “from”: {              “id”: 309061307,              “title”: “Notify all agents of received request”            },            “rel”: “trigger”          }        },        “subject”: “[{{ticket.account}}] {{ticket.title}}”,        “body”: “A ticket (#{{ticket.id}}) by {{ticket.requester.name}} has been received. It is unassigned.\n\n{{ticket.comments_formatted}}”,        “recipients”: [          22098125687        ]      }    ]  }}

Add the Close Ticket Method

From the Service Detail screen click Add Method.

Method Name: Close Ticket
Service Type: REST
Template Type: Zendesk Ticket
URI: https://(yourzendesksubdomain)/api/v2/tickets.json
Content Type: JSON
Web Method: PUT
Response Data Type: JSON
Response Action: Update Alert Fields = false

Content Data:

<pre>

{“ticket”: {“status”: “closed”, “comment”: { “body”: “<<MessageThread.Resolution>>”, “author_id”: 22098125687}}}

</pre>

Create the Add Comment Method

From the Service Detail screen click Add Method.

Method Name: Add Comment
Service Type: REST
Template Type: Zendesk Ticket
URI: https://(your zendesk subdomain)/api/v2/tickets/<<Attribute.Ticket ID>>.json
Content Type: JSON
Web Method: PUT
Response Data Type: JSON
Response Action: Update Alert Fields = false

 

Create the Close Ticket Workflow

Workflow Name: Zendesk Close Ticket
Workflow Type: Message Thread
Template: Zendesk Ticket
Scheduled: false
Enabled: true

Start Conditions:
MessageThreadStatusType = closed AND

 

Actions:
Action: Outbound Service Notification
Outbound Action: Zendesk – Close Ticket

Create the Add Assignment Comment Workflow

Workflow Name: Zendesk Add Assignment Comment
Workflow Type: Message Thread
Template: Zendesk Ticket
Scheduled: false
Enabled: true

Start Conditions:
MessageThreadStatusType = assigned AND

 

Actions:
Action: Outbound Service Notification
Outbound Action: Zendesk – Add Comment
Message Text: {“ticket”: {“comment”: { “body”: “Ticket has been assigned to <<MessageThread.OwnerName>>”, “author_id”: 22098125687}}}

 

 

Create the Add Delivery Status Update Workflow

Workflow Name: ZenDesk Add Delivery Status Update
Workflow Type: DeliveryAttempt
Enabled: true

Start Conditions:
DeliveryStatusType = sent OR
DeliveryStatusType = acknowledged OR
DeliveryStatusType = failed OR
DeliveryStatusType = delivered OR

 

Actions:
Action: Outbound Service Notification
Outbound Action: Zendesk – Add Comment
Message Text: {“ticket”: {“comment”: { “body”: “Delivery Status <<DeliveryAttempt.Status>> for user <<DeliveryAttempt.ContactName>> device <<DeliveryAttempt.ContactType>>.”, “author_id”: 22098125687}}}

Create the Zendesk Escalation Rule

Escalation Rule – Zendesk Alert

Detail
Rule Name: Zendesk Alert
Description: Zendesk Alert
Priority: Critical
Enabled: true
Quick Launch: false

 

Workflows
Filter by… Message Thread

Workflows:
Zendesk Add Assignment Comment
Zendesk Add Delviery Status Update
Zendesk Close Ticket

Others:
Thread Template

 

Services:
Zendesk
Service Action: Create Ticket

 

 

Did this answer your question?