Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Slack user who ran automation rule

Gary Spross
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 24, 2023

Is there anyway to send a Slack message to the user who ran an automation rule manually?

1 answer

1 accepted

0 votes
Answer accepted
Jehan Bhathena
Community Champion
July 24, 2023

Hi @Gary Spross ,

I haven't tested this out but in theory you can try add 2 actions in the automation you mentioned:

  1. Create a lookup table with Jira User's allowed to run the Trigger, along with their Slack Profile ID's : https://community.atlassian.com/t5/Automation-articles/New-Automation-action-Create-lookup-table/ba-p/2311333
  2. https://support.atlassian.com/cloud-automation/docs/use-automation-with-slack/ : map the above look up table's user in the "Send messages to a user"

This is sort of overkill but since you want to send a message from one tool to another mapping the Profiles ID's seems to one way.

Another way that can be :

  1. Fetch the user's email who triggered the automation
  2. Using https://api.slack.com/methods/users.lookupByEmail search for that Email's Profile ID
  3. Pass the above Profile ID in the "Send messages to a user" (Same link as shown in the above points) : https://support.atlassian.com/cloud-automation/docs/use-automation-with-slack/
Gary Spross
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 24, 2023

Thanks Jehan. I'm figuring the second option is more feasible as the majority of the users (if not all) will be able to run the rule, so there's a lot of users...

I'm trying to figure out how to make that api call from within the automation rule. You don't happen to have an example do you?

Jehan Bhathena
Community Champion
July 24, 2023

Ironically I haven't used Slack (ever) 😅

I'll give this a whirl on my instance once and let you know if it works.

Gary Spross
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 24, 2023

Oh, :laughing:.

Appreciate any guidance if you are able to take a look.

Thanks!

Jehan Bhathena
Community Champion
July 26, 2023

Hello again,

The closest I got to this was tagging the initiator in the message.

Fetch the User ID using Slack's API, then pass the response to the Jira WebRequest (instead of the Slack Message action)

image.png

Hope this helps :-)

Jehan Bhathena
Community Champion
July 29, 2023

Hey @Gary Spross ,

if the above workaround helps pls mark this thread as the accepted answer, so that it can help others identify this thread 🙂

Gary Spross
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 31, 2023

Hey @Jehan Bhathena! Thanks for your help with this. I haven't had the opportunity to fetch the user id through the Slack API yet, but I'm sure this is the right way to go. Thanks again for taking the time to help me out with this!

Like Jehan Bhathena likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events