Forums

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

How to send a Slack message to the user when they are mentioned in the Jira issue comment

Abhijeet Kale June 23, 2024

We have active Jira slack integration is setup on our Jira site and want to send a Slack message to the user when they are mentioned in the Jira issue comment to the team slack channel. 

 

3 answers

0 votes
Tommaso Gionfriddo _Teklada_
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.
June 23, 2024

delete

0 votes
Tommaso Gionfriddo _Teklada_
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.
June 23, 2024

Hi @Abhijeet Kale ,

If you already have the Jira Cloud for Slack app, then individuals may set up the app to notify them via slack for comments mentioning them etc. They can simply type /jira notify from any chat in Slack to get started.

If you need the ability to control this functional and force it upon users, you'll likely need to find a way to keep an up-to-date mapping of Slack users to Jira users, and then use something like ScriptRunner or Automation for Jira to check this mapping and then send the appropriate slack message.

0 votes
Ravina
Community Champion
June 23, 2024

I test this rule but looks like {{smart values}} condition does not matching

Tommaso Gionfriddo _Teklada_
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.
June 23, 2024

In Jira cloud, the comment body will not contain the user's email, instead it will display the user's account id, so the comparison would need to be {{issue.comment.last.body}} contains [~accountid:<user's account id here>]

The real issue with this solution however is that it only works for the single user whos accountId is hardcoded in the automation. Perhaps this is suitable for this question, however I'm assuming they want to send an email to any user who is mentioned.

Ravina
Community Champion
June 23, 2024

I test this rule but looks like {{smart values}} condition does not matching

Bill Sheboy
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.
June 23, 2024

Please stop posting answers generated by bots, particularly for rules which are misunderstood.

For example, the condition is incorrect and there is no reason to have the Re-fetch Issue action in the rule shown as apparently the bot's parser did not detect that.

Tommaso Gionfriddo _Teklada_
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.
June 23, 2024

@Ravina, checking if the comment contains the @ symbol is not correct, for multiple reasons

 

Primarily, the @ symbol is not included in the body of a comment when used to @mention a user. As such, the condition won't work. As I stated above, mentions are stored in the format [~accountId:myAccountIdHere]

 

Also, checking if a comment contains the @ symbol at any point will cause a lot of false positives.

Ravina
Community Champion
June 24, 2024

@Tommaso Gionfriddo _Teklada_I tired with {{comment.body}} and {{issue.comment.last.body}} but looks like the condition is not matching. no action is performed when I @ any user or just put @ in the issue comment, will look for another solution.

Suggest an answer

Log in or Sign up to answer