Hey I make automation that everytime when you mention some user in the comment he become the watcher also.
But the problem that is worked just when you tag only one user, if I tag multiple users its don't work.
can someone have answer what I need to change in the automation to fix it?
Im attach picture of the automation.
thanks.
(this is the smart value code:
{{issue.comments.last.body.split(" ").match("(accountid:.*)]").remove("accountid:")}}
Hi @Omri Zeman
To add multiple users mentioned as watchers the rule will need to iterate over them with advanced branching.
Please see this earlier post I made on how to do this: https://community.atlassian.com/t5/Automation-questions/Re-Re-Finding-Mentioning-a-User-in-Comment-and-Cust/qaq-p/2368567/comment-id/6895#M6895
Kind regards,
Bill
Is this the correct smart value code for now?
{{issue.comments.last.body.split(" ").match("(accountid:.*)]").remove("accountid:")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That will work, although there are various ways to perform the matching / parsing.
The key for your question about multiple watchers is the need for the branching. Please see that linked answer for more details.
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.
@Bill Sheboy One thing I've noticed is it's possible for users to be tagged in a comment without spacing between the tags, so the above smart value with split would only work for
[~accountid:XXXXX] [~accountid:XXXYYYYY]
and not for
[~accountid:XXXXX][~accountid:XXXYYYYY]
Have you run into that and found a more preferred matching/parsing approach on your end?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The split() helps to solve some formatting problems, but isn't strictly necessary. It can help with newlines and markup in the field.
Two alternatives are to remove the split() and try:
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.
Thank you, Bill! I ended up going with this solution, which seems to be working for all my different tests. It will extract any account IDs mentioned in the comment regardless of how they're spaced or not:
{{issue.comments.last.body.match("\[~accountid:(.+?)\]")}}
Fingers crossed I don't run into any edge cases!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Omri Zeman
Seem the smart value of your automation is correct. -> KB link https://community.atlassian.com/t5/Jira-articles/Auto-Add-Watchers-When-User-Is-Mentioned/ba-p/2556829
Can you share the log automation ?
Best,
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.
Hello @Omri Zeman
Based on your screen, the smart value doesn’t seem to match the condition.
That’s why the automation isn’t adding the ID of the tagged person as a watcher.
Can you check if some logs have successfully recorded actions?
If all logs didn’t meet the condition, maybe you can try adding a "log action" with the same smart value just before the condition to verify what the value is.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Omri Zeman,
Alternatively, if you’re regularly working with mentions and need a more streamlined way to manage them, have you checked out the Mentions Dashboard for Jira? It’s a gadget that helps you track and manage all mentions in Jira comments. This could complement your automation by giving you a centralized view of all mentions across tasks, ensuring nothing gets overlooked.
With the Mentions Dashboard, you'll be able to:
Add-on newly released and developed by my team.
Best of luck with your automation!
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.