Hi,
My goal is to add as watcher the first person tagged in a comment (no iterative branch in this case). I'm in a data center instance.
I followed the recommendation from Bill in this topic :
https://community.atlassian.com/t5/Jira-questions/Automation-Help-Add-watcher-when-user-mentioned-in-comments/qaq-p/2121329
I have done a test by creating a comment with my coworker tagged "Test Automation @mycoworker" and checked in the audit log : the @mycoworker is not recognized.
It looks like the smart value is not working for me:
{{issue.comments.last.body.split(" ").match("(accountid:.*)]").remove("accountid:")}}
Any help on this please?
Thanks,
Regards
Hi @Garn
First thing, I am using Jira Cloud and not Data Center, and so please test the solutions I offer with your site.
The other question you linked to uses a solution approach for Jira Cloud, which includes a user's account id to implement a mention. However, I believe Jira Server and Data Center use a different mechanism with the user name.
Let's confirm that with your test rule: add a write to the audit log with this:
last comment body: {{issue.comments.last.body}}
Test your rule and review the log. I suspect the entry looks like this:
last comment body: here is my comment mentioning [~billsheboy] in the sentence
If that is the case, you may adjust the match() and remove() function parameters accordingly.
Kind regards,Bill
Hi Bill,
Thank you for your help!
It displays:
last comment body: Test Watcher [~201034280]
With 201034280 being the identifier of the user.
Could you please share what it looks like in cloud so I can understand how to adjust match and remove functions please?
Thanks for testing that!
For Jira Cloud, the mentions work like this, where 12345abcde would be the user's Atlassian account identifier:
[~accountid:12345abcde]
And so a change for your version to get the user identifier could be this:
{{issue.comments.last.body.split(" ").match("(\[~.*\])").substringBetween("[~","]")}}
Please test this for your instance.
Yes, thanks, we're almost there!Now I have an error on the manage watchers action:
In my action, I'm adding as watcher my variable {{addwatchers}}
Do you have any clue on the error right here? Thank you,
It looks like you're new here. Sign in or register to get started.