Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


JIRA Cloud Scriptrunner - Create issue with multi select list not working


I've managed to write a script using API Post to create an issue with all the required fields, but I have a problem with multi select list fields. Whatever I try, these fields remain empty. Can anyone tell me what is wrong with this ?

Here's my script :

def projectKey = 'KESD'
def projectId = get("/rest/api/2/project/${projectKey}").asObject(Map)
String email_resp = ""
String email_rapp = ""
def url_resp = "/rest/api/2/user/picker?query=${email_resp}"
def url_rapp = "/rest/api/2/user/picker?query=${email_rapp}"
def response_resp = get(url_resp).header('Content-Type', 'application/json').asObject(Map)
def accountId_resp = response_resp.body.users.accountId[0]
def response_rapp = get(url_rapp).header('Content-Type', 'application/json').asObject(Map)
def accountId_rapp = response_rapp.body.users.accountId[0]
def ticketType = get("/rest/api/2/issuetype/project?projectId=${projectId}").asObject(List).body.find { it['name'] == 'ServiceRequest' }['id']
        .header('Content-Type', 'application/json')
                        fields: [
                                summary    : 'The issue summary',
                                description: """Hello,
This is the issue description.
                                project    : [key: projectKey],
                                issuetype  : [id: ticketType],
duedate   : "2023-07-17",
                                reporter : [id: accountId_rapp],
  assignee : [id: accountId_resp],
  customfield_10138 : "DRIVER",
  customfield_10142 : "HOTELS",
  customfield_10133 : [{name: 'PARIS'}],
  customfield_10143 : [id: "10440"],
  customfield_10445 : [{name: 'No Hardware'}],
  security : [name:'DSI']

 Everything works fine, except for the customfield_10133 and 10445, which are multi-select list fields with only one value. I tried {id: "<optionId>"}, {name: "<optionValue>"}, {value: "<optionValue>"}, didn't work. I tried with quotes on "id", "name", and "value", I got the " expecting '}', found ':' " error. And if I remove the {} brackets, I get the "value must be in a table" error.

I cannot find the exact syntax for that, all examples on the internet point to other ways to do it with lots of java methods, or Server/Data Center compatible methods.

Thanks for your help.


2 answers

Suggest an answer

Log in or Sign up to answer

Hi David, 

You can set a multi select field using the below syntax:

"customfield_10133": [value: "PARIS"],[value: "BERLIN"]],

I hope this helps! 



As I mentionned in the description, I already tried that, and I get the "Specify the value for xxx in an array" error.


Hi David,

In your description you've said you were using brackets {value: "<optionValue>"} but you need to use [] instead [value: "PARIS"].

Hi Lucy,

I did, and I get "Specify the value for xxx in an array" error. I am going to submit a support request from Adaptavist.

I found the answer. The correct syntax is :

customfield_10133 : [[value: "optionvalue"]], so double square brackets around the set of values.


0 votes
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jul 07, 2023

Hi, @David Maurel 

I found example, that maybe can help you

"customfield_13222" : [{"add" : {"value" : root_cause_value}}]

In similar question it worked

Hi Evgeniy,

Just tried it, didn't work. Adding the quotes around add and value gets me the  " expecting '}', found ':' " error. If I remove the quotes, I don't get the error, but the fields are not populated with my values.

AUG Leaders

Atlassian Community Events