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 an HTTP target (in Zendesk)
Navigate to the Extensions page: Admin > Extensions, and click the Add target link.
Select an HTTP target
Now is when you need the Webhook URL from before, insert it in the URL field.
Also, give the target a title, set method to post and content type to JSON.
Select Create target and push Submit.
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.
-
Great post!
-
This is awesome. Thanks for sharing Jacob!
-
Thanks, guys!
-
Excellent tip, Jacob! Complete with step-by-step instructions and screen shots.
Thanks for sharing!
-
*Updated* HI Jacob J Christensen - Cloudhuset A/S Thank you for this article, I am experiencing an issue getting the notifications into slack which I am hoping you can help me out.
Objective: send Slack Notification for tickets with High or Urgent priority to the assignee when end-user has replied to a ticket.
I tested the Extension and received the notifier via my personal slack DM/Channel, my test ticket will send directly to me if the ticket has a MEET any condition of Assignee is Jesse Marion
Is there any rule/code that can DM the assignee of a ticket when the end-user replies on a ticket with Urgent/High priority? @Slack_user or something?
-
Hi Jesse,
I'm glad you're finding the article useful. It has been a while since I set this up and I'm not currently relying upon it for work.
I'm sure there is a way to achieve the advanced DM setup you're seeking, but it's a bit out of my reach at the moment.
I would probably opt for something simpler like a shared channel and have the individual agents set up keyword alerts for their agent name.
Is that something that could work for you?
-
Used this post twice already, how come I can't like twice ? :)
-
It's just the way Gather's voting works. But we are so glad to hear that Jacob J Christensen - Cloudhuset A/S's post has been so helpful to you!
-
Hey,
Is there any to implement slack @here for example in these webhooks?
Thanks
-
Hi Jamal,
Sorry I didn't see your comment until now.
Adding the following to the "text" part of your JSON should include an @channel mention to the message:
<!channel> \n
This is what it looks like for me:
I haven't tested if the same is true for @here, but perhaps you can try that out and let me know how it goes?
-
Great article and easy to follow.
Thanks for putting this together.
サインインしてコメントを残してください。
11 コメント