When an end user is chatting with your bot outside opening hours, it can be useful to design a flow that allows them to leave a message so that the agents may respond to their request when available. If you have a Zendesk Support subscription, we recommend using our Zendesk Support Create Ticket webhook template which will be described below. If you do not have a Zendesk Support subscription, we recommend using our BotXO Dynamic Email Notification webhook template.
For an easy-to-follow look at ticket creation in Zendesk Support, please refer to the following video tutorial:
In this article, we will be focusing on the most common configurations of the Zendesk Support Create Ticket webhook template.
Standard configuration of the example body
{
"request": {
"requester": {
"name": "{{userName}}",
"email": "{{userEmail}}"
},
"subject" : "Ticket automatically created from BotXO",
"priority" : "normal",
"type" : "task",
"comment": {
"body": "{{userMessage}}"
}
}
}


Customizing the example body
Tags
{
"request": {
"requester": {
"name": "{{userName}}",
"email": "{{userEmail}}"
},
"subject" : "Ticket automatically created from BotXO",
"priority" : "normal",
"type" : "task",
"tags": ["tag1", "tag2"],
"comment": {
"body": "{{userMessage}}"
}
}
}
Tags must be placed within an array (square brackets). You can also use custom variables to make the tags dynamic through the use of the Store End User Reply in a Custom Variable function, as seen here:
{
"request": {
"requester": {
"name": "{{userName}}",
"email": "{{userEmail}}"
},
"subject" : "Ticket automatically created from BotXO",
"priority" : "normal",
"type" : "task",
"tags": ["{{tag1}}", "{{tag2}}"],
"comment": {
"body": "{{userMessage}}"
}
}
}
Custom fields
{
"request": {
"requester": {
"name": "{{userName}}",
"email": "{{userEmail}}"
},
"subject" : "Ticket automatically created from BotXO",
"priority" : "normal",
"type" : "task",
"custom_fields": [{"id": 360007562940, "value": "reset_password"}],
"comment": {
"body": "{{userMessage}}"
}
}
}
In the example above, we're filling the custom field with the ID "360007562940" with the value "reset_password". You can use the code snippet (marked in bold) above to set the value for any ticket field. If you want to create a field of your own, you can navigate to the following URL (replace "{your_subdomain}" with the name of your own Zendesk subdomain):
https://{your_subdomain}.zendesk.com/agent/admin/ticket_fields
Depending on the type of the specific custom field you're setting a value for, you may see some tags being created automatically as a result of your webhook. The three types of custom fields that add tags are the "drop-down list", the "checkbox", and the "multi-select" fields.
For more information about the different types of custom fields, please refer to Zendesk's documentation on setting custom field values.
Ticket form
Enterprise-level Zendesk Support subscription required
If you have multiple ticket forms on your Zendesk environment, we recommend setting the specific ticket_form_id in the body of the Create Ticket webhook. You can find the ID's of your ticket forms on https://{your_subdomain}.zendesk.com/agent/admin/ticket_forms (replace "{your_subdomain}" with the name of your Zendesk subdomain).
{
"request": {
"requester": {
"name": "{{userName}}",
"email": "{{userEmail}}"
},
"subject" : "Ticket automatically created from BotXO",
"priority" : "normal",
"type" : "task",
"ticket_form_id": "360003653593",
"comment": {
"body": "{{userMessage}}"
}
}
}
Comments
0 comments
Please sign in to leave a comment.