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.
Hi @Martin Fukatko
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.
Kind regards,Bill
@Bill Sheboy
Bill, thank you for answer.
Don't you have an example for "regular expression with match() to parse the users' account ID values out of the comment" ?
Hi, Martin.
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:
{{issue.comment.last.body.split("\n").match("\[~accountid:(.*)\].*")}}
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.
It looks like you're new here. Sign in or register to get started.