You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I'm pretty new to Jira, and I'm implementing some automations in my Service Desk project.
Among them, there is one automation that should execute when any user mentions another user that specifically belong to a defined project role (in an internal comment).
What I'm looking for here is: in automation, what would be the way to 1. check if a comment is internal and 2. if the user mentioned in this comment belongs to a specific project role?
Didn't find anything that could help me around here, looking forward for answers!
Hello @Pierre-Xavier Puissant
Welcome to the Atlassian community.
If you use the Issue Commented trigger then you can use an Advanced Compare to check if the comment was an Internal comment thus:
There is a method to extract from a comment all the users mentioned in that comment, described as part of this article:
However there is not currently a simple action/condition in Automation for Jira to check if a user is a member of a project role. There might be a way to check that through a REST API call made through a Send Web Request action, but I have not tried to figure that out.
Thank you very much @Trudy Claspill for your answer. It's a shame that Jira doesn't support this out of the box...
However, I see another option. It happens that the number of users belonging to the Project Role is pretty low (~8). So the other way would be to check whether any of those users is mentioned in the comment...
How is it possible to check if user x, y or z (let's say) is mentioned in the comment? Is it a basic string check?
What is actually stored in the comment when a user is mentioned is their account ID, not their name. The UI automatically converts that to display the name when you are viewing the issue, but in an Automation Rule if you used the Log action to print the comment body to the execution log you would see something like this for each mention:
To check if a specific user is mentioned you will have to get their account ID. You can do that using the View all issues screen to enter a search against a user field for the user:
You can type in the user's name to get a list of possible matches. Then when you pick the specific user the JQL will automatically update to show the user's account ID.
You can then plug that in to an Advanced Compare for a text comparison like this
If you want to check if any one or more of multiple users are mentioned in the comment then you would need to use the IF/ELSE block condition and add a condition for each user.
Make sure that you set the IF block to At least one condition matches.