Tip: Get Notified in Slack when @Mentioned on a Ticket | The place for Zendesk users to come together and share
Skip to main content
February 11, 2021

Tip: Get Notified in Slack when @Mentioned on a Ticket

  • February 11, 2021
  • 14 replies
  • 194 views

The Problem 

Tickets I was @mentioned on were slipping through the cracks. The in-app notifications were helpful when I was in the Zendesk UI, but I spend 40% of my time outside of the queue. Email notifications were also a challenge due to the volume of tickets I handle each week. It was difficult to keep up. 

The Solution 

Utilizing a trigger, Slack webhook, and a Zendesk webhook I was able to implement a solution that would notify me in Slack each time I was @mentioned on a ticket. 

Instructions 

Step 1

If you don’t have one already, you’ll need to create a Slack webhook. Note: You might need your Slack Admin to help you set up the actual webhook in Slack. 

For this specific solution, I’d recommend using a webhook for your personal Slack DMs, but you can definitely pipe these notifications into any Slack channel of your choosing. 

Step 2

Next, you'll want to create a Zendesk webhook based on a Slack webhook URL. To do this, navigate to the Webooks page: Admin Center > Apps and Integrations > Webhooks, and click Actions > Create Webhook. Next, enter:

  • Name for this webhook
  • The Endpoint URL which is your Slack Webhook URL.
  • Set Request method to POST

Click Create and then Complete setup on the following screen.

Step 3

Create a new trigger to notify this webhook using the following Conditions:

  • Comment is Private
  • Comment Text contains the following string <<your name>> 

Note: If you have an Alias Name setup in your Zendesk User Profile, you’ll want to use your Alias Name for the Comment Text condition. At the time of writing this, Zendesk will look for the Alias name associated with the @mentioned user rather than the actual comment text.

For the Action, you'll select Notify Active Webhook and then locate the webhook you just created. For the JSON body, you can enter any JSON content that you’d like to include within this notification. For example:

{
"attachments":[
{
"fallback":"You've been mentioned on a ticket",
"pretext":"You've been mentioned on a ticket",
"color":"#D00000",
"fields":[
{
"title":"Subject: {{ticket.title}}",
"value":"{{ticket.url}}",
"short":false
}
]
}
]
}

Step 4

Test this trigger out to make sure it’s working as expected. 

That's it!

It’s a simple solution, but it’s been really helpful for myself and a few of my colleagues so that we can keep a closer tab on the tickets that need our attention. I hope this tip is helpful for other community members. 

14 replies

Sehee
August 17, 2023

Thanks! I solved it thanks to 😆

Suzanne12
February 20, 2024

When I am @ mentioned in a ticket reply, I have it configured to post in a slack channel and have added the keyword "Suzanne" to my slack settings. Is it possible to set it up to ping me in Slack? 

I've tried formatting the JSON message to say:
"fallback":"@Suzanne You've been mentioned on a ticket",
"pretext":"@Suzanne You've been mentioned on a ticket",

@Suzanne is my Slack name. 

But the notification only shows in my slack Activity feed. 

Thanks!

Employee
February 22, 2024

@suzanne12

To achieve a direct ping (mention) in Slack when you are mentioned in a Zendesk ticket, you're on the right track by configuring the JSON message for posting in a Slack channel. However, just including "@Suzanne" in the JSON message doesn't automatically translate to a mention in Slack due to how Slack handles user mentions in their API.

In Slack, to mention a user, you need to use the user's unique ID rather than their username. User IDs in Slack start with "U" followed by a series of letters and numbers (e.g., U123ABCD).

Here's how you can adjust your approach:

  1. Find Your Slack User ID:

    • You can find your user ID by clicking on your name in Slack, going to your profile, then clicking on "More" and choosing "Copy member ID."
  2. Adjust the JSON Payload:

    • Once you have your user ID, you need to adjust the JSON payload to use the Slack format for mentioning a user. Instead of "@Suzanne", you would use something like "<@U123ABCD>", where "U123ABCD" is your user ID.

Here’s an example of how your JSON message should look:

{ "fallback": "<@U123ABCD> You've been mentioned on a ticket", "pretext": "<@U123ABCD> You've been mentioned on a ticket", ... }
  1. Configure Zendesk to Slack Integration:

    • Ensure that your Zendesk to Slack integration is correctly set up to send these notifications as intended. This might involve configuring webhooks or using Zendesk's built-in Slack integration features.
  2. Check Slack App Permissions:

    • Ensure that the Slack app (which is posting these messages to your channel) has permissions to mention users. Depending on your Slack workspace settings, there might be restrictions on which apps can mention users or post certain types of messages.
  3. Test Your Configuration:

    • After making these changes, test the configuration by having someone mention you in a Zendesk ticket to see if the Slack notification correctly mentions you.


That should handle take care of it!  

Yosef11
Newcomer
October 21, 2024

Hey everyone! 👋

If you’ve ever wanted to get Zendesk mentions sent straight to Slack, we’ve just launched an app that does exactly that! No more missed comments or slow responses—everything goes right into your Slack channel.

Check it out on the marketplace if you’re interested: ZenMention 😊

Let me know if you have any feedback!