Question

Is it possible to trigger a workflow based on an @mention of a specific group or user in any channel?


Userlevel 1
Badge +1

I’m interested in triggering a workflow based on an @mention of a specific group (and/or user) in any channel.  Is this something that can be done?
Thanks!


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

13 replies

Userlevel 7
Badge +14

Hi @quercus 

Good question.

What app are you trying to use? (e.g. Slack)

Userlevel 1
Badge +1

Yes, Slack.  

Userlevel 7
Badge +14

@quercus 

Try adding a Filter as Step 2 in the Zap: https://zapier.com/apps/filter/help

Available Slack Triggers:

 

Userlevel 1
Badge +1

Thanks.  I seem to be missing a step between workflow builder mentioned here and the linked triggers.
 

Userlevel 7
Badge +14

@quercus 

Try following this guide to trigger a Slack Workflow from a webhook: https://slack.com/help/articles/360041352714-Create-more-advanced-workflows-using-webhooks

 

Zap Action: Webhook - POST

Userlevel 1
Badge +1

The trigger action I’m looking for is an event in Slack…  any user “mentions” a specific group in any channel, I’d like to pop up a form for the user to fill out, and use that form to create a ticket (or something similar). 
There are examples of this happening from clicking a button in slack…  I’d like to do the exact same thing but rather than the trigger being a button click, it is a “mention” of a specific group, in any channel. 

The link above seems to expect the trigger to come from an external source.  Can I set up slack to be its own external source?

Userlevel 7
Badge +14

@quercus 

Try these Zap steps:

  1. Trigger: Slack - New Message Posted to Channel
  2. Action: Filter
  3. Action: Webhook - POST

 

 

Userlevel 1
Badge +1

Ahh, turns out this was super duper easy once I got access to Zapier.  Thanks!

Userlevel 7
Badge +11

Glad to hear it, @quercus! 😁

Seems like Troy was able to help get you pointed in the right direction and you’re all set for now. If that’s not the case and you need further help here please do let us know. 

In the meantime, happy Zapping! ⚡ 

Userlevel 1
Badge +1

Glad to hear it, @quercus! 😁

Seems like Troy was able to help get you pointed in the right direction and you’re all set for now. If that’s not the case and you need further help here please do let us know. 

In the meantime, happy Zapping! ⚡ 

Hi SamB, I am also a SamB!
One followup question…  IDK if this is a bug or WAI.

In order to get a group mention to work, I created a Trigger step for Slack->Mention->UserName->Custom Name with the value being the group id (“!subteam^S01L23ABCDE”)…  and it works…  but it also triggers if that string appears in bare text in a message, even though Slack doesn’t view that as a mention.  

We use the string ID rather than a mention for other test messages so that we don’t live-ping users for tests, which means we’d also like our Zap to not trigger on test messages (and I didn’t think it would since it isn’t a mention).  
Is there a known workaround for this?

Thanks!

Userlevel 7
Badge +11

Happy to help with this @quercus!

Am I right in thinking that instead of using the New Message Posted to Channel (Slack) trigger Troy suggested, you’re using the New Mention trigger instead? 

If so, the expected behaviour with that trigger is that it would run “when a username or highlight word is mentioned in a public #channel”. The help text for the Username field on that trigger, states that “Linked mentions of this user will trigger the zap” but it sounds like instead of only picking up linked mentions it’s also picking up keyword for that group ID. If that’s the case, I’d recommend flagging this with our Support Team as it could well be a bug. They’ll be able to dig into the logs for the Zap and open up a bug report for this as necessary.

In the meantime, turning off the Zap and pulling in new mention test records would allow you to continue testing the Zap and prevent it from triggering for the test messages. Alternatively, if you want to run live tests, you could create a new group on Slack for testing purposes and set that test group’s id as the custom username in the Zap. That way you could carry out live tests and it would only notify users in the test group you created. Then once you’re happy that the Zap is working correctly you would change it to use the previous group id so that the correct people are notified when the Zap runs live.

Hope that helps. If I’ve misunderstood the issue or you’re still running into some trouble here just let us know! 🙂

Userlevel 1
Badge +1

Yes.  We have thousands of channels, so it is not feasible to set up and maintain a Zap for each one.  For now, our test messages are mostly grouped in a single channel that we can exclude with a filter, at the cost of missing a real ping from that channel…  a tradeoff that we think is probably worth it.

I did reach out to support about this and one other issue.  For this issue, support recommended filtering out messages with an `@`, which doesn’t work because there is an `@` elsewhere in the same test message.

For the other request (a mention that didn’t trigger the zap), I was told that Group Mentions is not supported 😭.

Good idea about trying a new test-run of the zap… I wonder if I can get test data off of an old slack message… that might help me debug why the zap didn’t fire.

Userlevel 7
Badge +11

Thanks for getting back to me here, @quercus.

Ah yes, it’s definitely sounds like a better approach to use the New Mention trigger, rather than setting up a Zap for each of the thousands of different channels! 

Glad to hear Support got back to you on your requests. Sorry that their suggestion of filtering out messages with the @ symbol won’t be a viable option, and that the group mentions aren’t supported on for the other request you had. 

Fingers crossed you’ll have more success using a new test run of the Zap. If you’ve already pulled in an old Slack message then you can select it in the Zap and use that for testing purposes.

Please do keep us in the loop on how you get on with this, eager to ensure you’re all set here!