I need to create a Jira rule that is triggered when a specific person is mentioned in a comment using the @ feature.
Example: In a comment someone writes
"@John Smith This is now ready for testing."
I want to trigger a rule
But if someone writes
"@Jane Smith This is now ready for testing."
I don't want to trigger the rule
Hi @Howard Sims -- Welcome to the Atlassian Community!
No, you cannot prevent the rule triggering. But you can prevent it from continuing to process...
When someone is mentioned in a field, that appears like this internally:
[~accountId:557057:1d4fd7f4-bbac-4466-82ee-aaabbbccc]
Their user account ID value is used rather than their display name.
And thus a rule could use a Smart Values Condition immediately after the trigger to check if a specific user was mentioned.
Kind regards,
Bill
What do I use to get the contents of the comment? and how would I search in it for the nameID?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First thing: based upon your response, I recommend pausing to read the introductory information on automation rules and smart values:
Learning more about automation before trying to write a rule will help you experiment and better understand how to write and manage rules effectively.
Back to your follow-up questions, getting the contents of the comment depends upon your rule trigger...
Let's assume your rule is triggered on Work Item Commented. Then the comment from the trigger would be {{comment}} and the text in the comment would be {{comment.body}} The Smart Values Condition could then test for the expression in that text.
You will need to find the user's account ID for the condition, using their profile information, JQL, the REST API, etc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome; I am glad to learn it is working! Please consider marking this question as "answered" to help others with a similar need find solutions faster. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.