Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to append a user to a multi select user field in Jira Automation

Michael Davison
Contributor
April 7, 2022

I have an automation that checks for updates on a series of fields. I would like to append the initiator of the field changes to a multi-select user picker called Transport Approvers.

I wanted to use this Transport Approvers field to capture all users who initiate the field changes.  However when I run the automation, and test with different users, I can only write over the previous user in the Transport Approvers multi-select field only allows me to write over the previous value, not append an additional one to the field. 

Is there a way this can be done? Thanks in advance.

Screen Shot 2022-04-07 at 7.28.30 AM.png

2 answers

1 accepted

2 votes
Answer accepted
Michael Davison
Contributor
April 8, 2022

Using the advanced option, I added this code snippet and it works perfectly:

 

{
    "update": {
        "MultiUserPicker": [{
                "add": {"accountId":"{{initiator.accountId}}"}
        }]
    }
}

 Where "MultiUserPicker" is the name of my field.

Ilia Tsvetkov
Contributor
March 28, 2023 edited

This doesn't work for me. I have a multi-user field called "Contributors".

Screenshot 2023-03-28 141418.png

My json is identical to yours:

 

{
"update": {
"Contributors" : [{
"add": {"accountId":"{{initiator.accountId}}"}
}]
}
}

 

but I get this error 

Additional fields contains invalid field(s) in 'update' or 'fields' section: Contributors

 

Any ideas on what am I doing wrong? 

 

KR, Ilia

Melanie Muschick
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 5, 2023

If your field is a custom field, you most likely need to use its id like "customfield_12345"

Howell, Adrianna June 6, 2023

Did this correct the issue?

0 votes
Mayuresh Kamble September 11, 2023

Hi @Michael Davison ,

Could you please tell me how this solution can be implemented in Jira server.

Suggest an answer

Log in or Sign up to answer