Setting up a workflow that sends notifications in Slack when a ticket is rated negatively allows proactive handling of concerns and improves customer satisfaction. Achieve this goal through a combination of a custom Slack app with an incoming webhook, Zendesk webhook, and trigger.
The workflow includes the following step:;
- Step 1: Create an app in Slack and an incoming webhook
- Step 2: Create a webhook in Zendesk to send CSAT tickets to your new Slack webhook
- Step 3: Create a trigger to send negative CSAT tickets to your Slack channel
Step 1: Create an app in Slack and an incoming webhook
- Create a custom Slack app following the Slack API document: Your Apps
In this example, the Slack app is named CSAT Notifier. - In Slack, the settings enable Incoming Webhooks using the toggle under Features > Incoming Webhooks.
- At the bottom of the Incoming Webhooks page, select Add a New Webhook to Workspace. As you configure the webhook, choose what channel should receive the notifications from the drop-down option. In this example, a unique Slack channel #zendesk-bad-csat was created to receive the notifications.
- After creating the URL, the system brings you back to a list of URLs for your app. Copy the one you just created using the Copy button.
For more information on creating Slack webhooks, see the Slack documentation: Sending messages using Incoming Webhooks.
Step 2: Create a webhook in Zendesk to send CSAT tickets to your new Slack webhook
- In Zendesk, create a new webhook.
-
Use the following configuration
- Name | Send negative CSATs to Slack
- Endpoint URL | [Paste the Slack incoming webhook URL copied from step 1.4]
- Request method | POST
- Request format | JSON
- Authentication | None
Note: No credentials are required. The URL itself includes the secret required to POST messages.
The webhook should appear similar to the below image.
Step 3: Create a trigger to send negative CSAT tickets to your Slack channel
Lastly, create a trigger to specify what tickets should be sent to your channel. For this example, notify any tickets that receive a Bad or Bad with Comment CSAT. Follow the steps below to create this workflow.
- Create a new trigger.
- Under Meet ALL of the following conditions add:
- Ticket | Is | Updated
- Current user | Is | (end-user)
- Under Meets ANY of the following conditions add:
- Satisfaction | Changed to | Bad
- Satisfaction | Changed to | Bad with comment
- Under Actions add:
-
Notify webhook | [select the webhook created in Zendesk]
- In the Body enter the information you'd like to receive in Slack using JSON formatting.
Note: See the example below of a properly formatted JSON payload.
-
Notify webhook | [select the webhook created in Zendesk]
- Select Save.
JSON body example
JSON formatting is highly customizable. Formatting options for Slack webhooks are included in the Slack article: Sending messages using Incoming Webhooks.
You can also include ticket-specific information using Zendesk placeholders. For more information, see the article: Zendesk Support placeholders reference.
However you choose to configure the information sent to Slack, you must start the JSON body with {"text":}
for the call to be received in proper formatting.
In this example the JSON body is configured to send the ticket ID, a link to the ticket, the CSAT rating, and the CSAT comment to the Slack channel using the following JSON payload:
{"text":"You've received a negative CSAT. See information below \n ticket ID:{{ticket.id}} \n ticket link: {{ticket.link}} \n csat rating: {{satisfaction.current_rating}} \n csat comment: {{satisfaction.current_comment}}"}
The end result should be similar to the image below.
Now when your account receives a bad CSAT notification, Slack will also be notified.