How to Add multiple users to a Custom field when they are tagged in a comment in the Jira Automation.
Hi @Seenivasan K
To better understand this can you tell us;
- Is the custom field a user picker field?
- A text field?
- A picklist?
Regards
Aaron
yeah its the custom field a user picker field @Aaron Pavez _ServiceRocket_
First, we can use this reply from @Bill Sheboy to extract the ID from the user mentioned in the comment
https://community.atlassian.com/t5/Automation-questions/Re-Re-Finding-Mentioning-a-User-in-Comment-and-Cust/qaq-p/2368567/comment-id/6895#M6895
Then you can add the value using this JSON body:
{ "update": { "userpickerfieldhere": [{ "add": {"accountId":"{{accountvariablehere}}"} }] } }
Now if you want to append, you need to use:
{{fromString}} {{toString}}. More on that here:
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/
That should put you in the right track. Let us know how it goes!
Hi @Seenivasan K ,
As @Aaron Pavez _ServiceRocket_ said, you need to extract the User from the comment and then add it to the custom field, so the rule is:
I am adding some screenshots of the testing of the rule on my test instance, in my case, I added the users to a field called Approvers:
Hopefully this helps you build your Automation rule.
Regards,David
Thanks for the reply @David Freitez
Can you please elaborate branching and create variable in this automation, as I am facing Error.
Above attached screenshots are my automation, but it adds only one user in the customfield. I want to add multiple users dynamically. @David Freitez @Aaron Pavez _ServiceRocket_
Adding to the suggestions from @Aaron Pavez _ServiceRocket_
In the linked post Aaron provided, that scenario was to Add Watchers, and so branching was appropriate.
But you are trying to select values in a multiple-select user field, correct?
If so, branching is a bad idea: advanced branching executes in parallel and asynchronously, processing in no particular order or timing. This mean your rule's edits could repeatedly collide trying to edit the field.
Instead, once you have identified the users to add, find the current values, merge them with the new ones, and perform a single edit using JSON.
Kind regards,Bill
It looks like you're new here. Sign in or register to get started.