ZIS bundle: Posting a message to Slack when the ticket status changes

This example shows what a ZIS bundle would look like in order to post a message to Slack when a ticket status changes in Zendesk. It includes a custom action that posts a message to Slack. It uses the action in a flow, and the job spec associates the flow with the Ticket Created event.

Replace the following placeholders with your own values:

  • {integration_name} your integration name you created using the Create integration name endpoint in the ZIS Registry API.
  • {slack_token} with the token portion of a Slack webhook URL https://hooks.slack.com/services/{slack_token}.
{  "zis_template_version": "2019-10-14",  "name": "Simple Zendesk-Slack integration",  "description": "React to Ticket events in ZIS with a Slack message",  "resources": {    "slack.post_simple_message": {      "type": "ZIS::Action::Http",      "properties": {        "name": "slack.post_simple_message",        "definition": {          "method": "POST",          "url.$": "https://hooks.slack.com/services/{{$.path}}",          "requestBody": {            "text.$": "$.slack_message"          }        }      }    },    "react_to_ticket_commentadded_flow": {      "type": "ZIS::Flow",      "properties": {        "name": "react_to_ticket_commentadded_flow",        "definition": {          "StartAt": "PostCommentAddedMessageToSlack",          "States": {            "PostCommentAddedMessageToSlack": {              "Type": "Action",              "ActionName": "zis:{integration_name}:action:slack.post_simple_message",              "Parameters": {                "path": "{slack_token}",                "slack_message.$": "A new comment: {{$.input.ticket_event.comment.body}}"              },              "End": true            }          }        }      }    },    "react_to_ticket_commentadded_job_spec": {      "type": "ZIS::JobSpec",      "properties": {        "name": "react_to_ticket_commentadded_job_spec",        "event_source": "support",        "event_type": "ticket.CommentAdded",        "flow_name": "zis:{integration_name}:flow:react_to_ticket_commentadded_flow"      }    }  }}