Is it possible to add multiple values in single select list using REST API ?

Hi,

I am new to JIRA & trying to insert/add multiple values in Single Select list field using REST API. I tried in lot of ways, but im able to insert/add only single value in select list using REST API through 3rd party plugin(rest-api-browser). But i can't  add multiple values, so anyone have an ideas on this, please let me know or guide.

1 answer

0 votes

A single select list, by definition, holds a single value.

So what you're trying to do here is nonsense.  You can't do it with REST because it only holds a single value.

single select list, by definition, holds a single value - Im trying to add extra values/options in drop down list.

Example : Name field having 2 values as John, Peter in select list. Now i would like to add Jack, Nelson, Victor, etc in that list by REST API.

I got an example from 3rd party plugin(Extender for JIRA) by inserting more than 1 values in Single Select list. FYI refer this link - http://www.itlab.net.pl/plugins/extender-for-jira/#ffs-tabbed-33|ffs-tabbed-11|ffs-tabbed-41|ffs-tabbed-21 

Response Body :

{
    "parentOptionId":"10105",
    "optionName":["New option 1", "New Option 2"]
}

 so im trying to implement the same. But its not working.

Oh.  You mean you are adding options, not setting the field to a value as you said before.

The REST API does not yet support doing that, so I assume that's what you have the extender add-on - have you got that installed?

The response you've got there looks like it's for a cascading select?  What are you posting?

I installed that plugin and running on POSTMAN as per steps given in that link. I m able to retrieve all custom fields and also getting configuration scheme for custom field, but unable to 

Add values into custom field configuration scheme

POST url - 

{JIRA_URL}/rest/extender/1.0/customField/getValue/{configSchemeId}

{JIRA_URL}/rest/extender/1.0/customField/getValue/10104

POST body Request -

{
    "optionName":["New option 1", "New Option 2"]
}

 

But im getting status as 404 Not Found :

 <status>
<status-code>404</status-code>
<message>null for uri: http://localhost:8080/rest/extender/1.0/customField/getvalue/10110</message>
</status>

That implies that the extender is not installed or that the 10110 is not a valid value for the post (wrong custom field id)

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 11, 2018 in Marketplace Apps

You + one app + a desert island...

Hi all! My name is Miles and I work on the Marketplace team. We’re looking for better ways to recommend and suggest apps that are truly crowd favorites, so of course we wanted to poll the Community. ...

2,768 views 5 6
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you