Auto-Add Watchers When Mentioned in the comment problem

Omri Zeman January 6, 2025

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:")}}

Capture 14.PNG

2 answers

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2025

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

Omri Zeman January 6, 2025

Is this the correct smart value code for now?
{{issue.comments.last.body.split(" ").match("(accountid:.*)]").remove("accountid:")}}

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 7, 2025

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.

0 votes
Duc Thang TRAN
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2025

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,

Omri Zeman January 6, 2025

Hey did you mean to that?

Capture 15.PNG

Duc Thang TRAN
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2025

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.

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events