You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Join now to unlock these features and more
Hi, I need to add all the users mentioned in created comment to custom field Cooperators.
Cooperators is a field with type "User Picker (multiple users)".
How to do it in Jira automation?
Thanks in advance for any suggestions.
A couple of ways to do this are with an advanced, smart value branch to loop and with a single edit:
Please consider if you want to clear or add to existing Cooperator values if multiple comments occur.
This is a complicated rule to write, so I recommend doing it one step at a time and writing the intermediate results to the audit log before making any edits to the issue.
Writing automation rules often requires experimentation. I encourage you to try things, such as writing comments to the audit log, to learn more about how Jira implements things like mentions...as that will give you ideas for how to parse them with regular expressions.
To get you started, this expression will return a list of user account ID values for the last comment added:
Hi @Bill Sheboy
already over a year old but I found your proposal and started using it but then I realized that the RegEx isn't fully correct and I am struggeling to get there - maybe you can/want to have a look?
The issue is that if there are multiple accountIds with text inbetween like "," or "and" they end up in the result as well as the regex doesn't stop for each accountId.
First, for an older thread like this, I recommend creating a new question and linking back to the older one. That will ensure the most number of people see it to help. Otherwise only the people following the old threads see them. Thanks!
Without seeing the details of your rule and a sample of your text with mentions...I suspect this is more of the challenges in the regular expression implementation for automation rules. The documentation describes they are "based on Java's Pattern class and uses Matcher.find() to find matches". However they do not describe what does / does not work the same.
In my earlier post, I suggested splitting on newlines to help the match() reduce the scope of match attempts. That might help for your case. I just retested with mentions separated by commas and "and" and the matches found all of them.