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 JobSpec associates the flow with the Ticket Created event.

Replace the following placeholders with your own values:

  • <YOUR_INTEGRATION> your integration name you created using the Create integration name endpoint in the ZIS Registry API.
  • <YOUR_SLACK_TOKEN> with the token portion of a Slack webhook URL https://hooks.slack.com/services/<YOUR_SLACK_TOKEN>,l-.
{  "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_message_action": {      "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:<YOUR_INTEGRATION>:action:slack.post_simple_message",              "Parameters": {                "path": "<YOUR_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:<YOUR_INTEGRATION>:flow:react_to_ticket_commentadded_flow"      }    }  }}