Hi guys, I'm trying to set an Automation rule in order to send an email to userB when userA has been tagged on the last comment (I need to be sure to check ONLY the last comment and not all the comments).
I've tried to use smart value {{issue.comment.last.body}} in order to access to the last comment text and try to match it with "test@gmail.com" or "[~test@gmail.com]" but none of these are working.
If I try to use JQL condition like: comment ~ "test@gmail.com" it works, but it validates ALL the comments and so this doesn't resolved my needs as I only need to perform some actions when a specific user is tagged on the LAST comment added.
Could you please help? thanks in advance!
Hi @Giada Ermacora and welcome to the community!
What if you try this for your JQL condition?
{{issue.comment.last.body}} ~ "test@gmail.com"
@Mark Segall unfortunately not, it throws an error as the comparison seems to be from text to text instead from field content to text, see my attachment. I’ve already tried to change @ with the suggested escape but nothing...I guess the JQL is wrong in this way
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Instead of JQL, try an advanced compare condition. If the advanced condition matches, then you send the email.
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.
If you are trying to find Jira mentions in the comments, rather than just an email address, please note that mentions appear in comment body as:
[~accountid:the_users_id_value] Here is a mention!
Please consider searching for that expression in those cases using match() rather than a JQL search/comparison.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy thanks for the heads up, I'm not able to find the user ID on Jira Server unfortunately, if I try to inspect the users, on the URL I can only see this: "jira/secure/ViewProfile.jspa?name=name@test.com" without any user ID (I know on the Cloud is visible directly on the URL instead), is there any other way to discover it? thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First thing: if your rule works with Jira Server with the email address for the mentions, keep using that. If not...
Perhaps try this JQL in advanced search to see if the user's name will lookup and replace with the account ID, as it does with Jira Cloud:
assignee = "enter the user name here"
You may then use that account ID value in the rule.
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.