Advanced Field Edit - Add multiple labels

Ryan Markle April 6, 2021

Can we add multiple labels through the advanced field edit?

 

i'm basically looking to do something like this:

 

{
        "update": {
                 "labels": [
                  {
                         "add": "Label1", "Label2"
                   }
                 ]
         }

}

 

It works fine for adding 1 label but I also need to add multiples and can't figure it out.

1 answer

1 accepted

3 votes
Answer accepted
Eric
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 6, 2021

Hi @Ryan Markle 

 

You can add multiple labels through advanced fields as follows:

{
    "update": {
        "labels": [
            {
                "add": "Label1"
            },
            {
                "add": "Label2"
            }
        ]
    }
}

 

Cheers,

 

Eric

Ryan Markle April 6, 2021

Thanks Eric!  That works.

 

Any idea how to handle that with an array list?  I have an array of label names I want to add to an issue. Is it possible to iterate over that array and add them?

Deleted user September 13, 2021

Did you get answer on that ?  Were you able to do it ?  I have the same issue...

Ryan Markle September 13, 2021

Unfortunately not -  I tried to a while before abandoning this approach and just going straight to the JIRA cloud API.

Deleted user September 13, 2021

Searched a little more and found this that does the trick : 

https://community.atlassian.com/t5/Marketplace-Apps-Integrations/How-to-copy-multi-value-field-in-using-Advance-Options-in/qaq-p/769692

{
"update": {
"labels": [{{#issue.customfield_10510}}{"add": "{{.}}"}{{^last}},{{/}}{{/}}]
}
}
Like # people like this

Suggest an answer

Log in or Sign up to answer