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

Not able to change values of a multiselect dropdown thru the rest API on scriptrunner

Nicholas Holleran February 10, 2023

I'm using scriptrunner to change certain custom field values, but for whatever reason I can't change value types that are multi select dropdowns. The script runs and returns a success but it doesn't actually work. If the multi select is empty when I run the script, nothing happens. But when the multiselect has a value and I try to run the  script, then the value is deleted and the field is set to empty.

def result = put('/rest/api/2/issue/' + issueKey)
        .header('Content-Type', 'application/json')
        .body([
        fields:[
                customfield_11623: [{value:"IO-TEST"}]
        ]
])

 

1 answer

1 accepted

1 vote
Answer accepted
Nicholas Holleran February 14, 2023

Solved, the solution is wrapping the value in double square brackets.

customfield_11623:[[value: "IO-TEST"]] 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events