Push notifications from Zendesk to Slack
The official Zendesk-Slack integration is very powerful, offering out-of-the-box two-way communication in a stylish way, but sometimes you just want a simple notification setup.
I hope this guide is helpful in showing the flexibility possible with Zendesk triggers and Slack.
Create a Slack app (in Slack)
[Alternatively, you could just create an incoming WebHook in Slack]
Make sure you're logged into Slack from your browser and proceed to:
https://api.slack.com/apps/new
Give the app a name that is appropriate, I've chosen Zendesk notifier for this example, and also select which Slack Workspace you want the notifications on (if you have multiple).
Push the Create app button.
On the next screen, under Add features and functionality, select Incoming Webhooks.
Switch on the incoming webhook and click the Add new webhook to Workspace link
Next up select the Slack channel you want the app to post messages to and Authorize.
Copy the webhook URL, we need that for the next step in Zendesk.
Create a Webhook (in Zendesk)
[@... - thanks for updating this section!]
Navigate to the Webooks page: Admin Center > Apps and Integrations > Webhooks, and click Actions > Create Webhook.
In the Create Webhook screen, enter:
- A Name which represents the webhook/channel
- The Endpoint URL which is your Slack Webhook URL from earlier
- Set Request method to POST
Press Create and then press Complete setup on the following screen.
Now we have created a link from Zendesk to Slack, next we need to create the trigger that will push messages through this connection.
Create a Trigger (in Zendesk)
Navigate to the Triggers page: Admin > Triggers and push the Add trigger button.
Set the conditions for when you want Zendesk to push notifications to Slack
You have a lot of options here to precisely specify what kind of updates you want notifications for, a few examples:
- A new ticket is created
- A new ticket is created for a particular channel (e.g. reviews from Trustpilot or Play Store)
- A ticket with elevated priority is updated by the requester
- A ticket is updated with a satisfaction rating (Steven Yan has a great post outlining this use case)
Below I set the trigger to fire when a ticket with a priority above Normal is created.
You could have multiple use cases in mind, and create a separate trigger for each of them if you would like.
Set the trigger action to push a message to the Slack target
Again you have a lot of options here, what content you want to include in the notification and you also have a number of styling options as well.
Below is the JSON used in the above example - be sure to update the YOUR-DOMAIN part to your specific Zendesk subdomain.
{
"text": "*New ticket* : <https://YOUR-DOMAIN.zendesk.com/agent/tickets/{{ticket.id}}|{{ticket.title}}>.\n*Requester* {{ticket.requester.name}} \n*Organization*: {{ticket.requester.organization.name}} \n*Updated*:{{ticket.updated_at_with_timestamp}}."
}
In the example here, I include a four-paragraph message stating that there is a new ticket - the ticket subject is linking to the ticket in Zendesk (for easy access), and the requester name and organization name are also included. And there is also a timestamp from the ticket update included.
Here is an example of what it looks like in Slack:
You can pull all kinds of user and ticket data into your message, see the Zendesk Support Placeholder Reference for all available options.
The above example is very basic in terms of style, you may want to add some bling to your messages, and for that Slack has its own message builder. You can add links, buttons, fields, images and colors to your messages.
Here's an example of a notification I did for incoming Trustpilot reviews.
💡 Check out the comment section below for more use cases.
💡 You can use placeholders to insert ticket or user content into the message.
💡 You can use Liquid markup to modify placeholder output, for example have a timestamp converted to something more readable, or have a nested field output only the last element.
-
Great article! One question though - I've setup a slack webhook, and created a trigger so that whenever a specific user is assigned a ticket they receive a slack notification. This works great, however, I am also seeing that notification on their individual channel, and being notified when it comes through on slack. No one else in my organization is seeing this so I can only assume that the webhook/trigger is setup in a way that alerts the creator of the trigger (me) as well as the intended recipient.
I don't see anything in the setup of the webhook or trigger that accounts for this behavior. Is it possible to alert only the intended recipient?
-
Hey Jacob Christensen
I am looking to piggy back off the setup that Victor Hrsit was asking about in the comments.
I am struggling with the slack_user_id custom field setupI want to be able to @tag the ticket assingee through the webhook in the slack channel.
I can get the @here & @channel webhook to fire correctly, but struggling with the agent setup.
Can you explain the exact setup for Zendesk>Custom fields? Do I require a custom field per agent with their slack ID? I'm currently testing this is the Sandbox setup, which is not integrated with Slack - but I imagine this does not matter.
Thanks in advance -
Hey Shane.
In one of the earlier comments I gave an example of how this could work using a user text field and a placeholder.https://support.zendesk.com/hc/en-us/community/posts/4409515187866/comments/4409515954970
And I think Viktor confirmed a solution just below. Let me know if you need more details. -
Hey Eric Sieker.
Did you work out your unexpected notification conundrum?
I'm not sure I follow who is getting the unexpected notifications and where. -
Really helpful article, however I'm asking myself how I can specify in the JSON which channel I wanna send my notification to ? I would have to send the notification to the slack tech_channel or sales_channel. Thank you for your help
-
Hey Max,
Glad you found it helpful!
A slack webhook is specific to a single channel, so you may need to create multiple to notify different channels.
I found this article that has more details on slack webhooks, hope you find it helpful.
https://api.slack.com/messaging/webhooks#create_a_webhook -
Hi there, very useful post.. although I am trying to set up an automation and I am struggling :
- one agent starts a side conversation with a special slack channel (tech)
- ticket status changes to on-hold
- automation firing a notification in the same slack channel if no answer from Slack channel after 24h
Is that possible ?
Thank you :)
-
Hey Max - thanks, I'm glad you find it useful!
That's an interesting use case!
I must admit that I've never used Slack with Side Conversations, so there may be possibilities I'm unaware of. If you have a way to identify which Slack Channel you've reached out to, you may be able to create a per Slack channel automation that will send a message based on "Hours since On-hold > 23 hrs (calendar)".
This could get a lot more complex if you have multiple side conversations on the same ticket.
I hope that's helpful, let me know if you have some specific challenges.
Please sign in to leave a comment.
38 Comments