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

Om Pravin S October 24, 2017

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
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 24, 2017

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.

Om Pravin S October 24, 2017

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.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 24, 2017

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?

Om Pravin S October 24, 2017

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>

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 25, 2017

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
TAGS
AUG Leaders

Atlassian Community Events