Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with adding values to a multi-select field in Jira Cloud via API

Claudine Warren May 14, 2024

I have a custom field that has 30+ values that can be chosen in any combination.  So for example the field could have A or A,B or A,B,C....the combinations are rather endless.  I have been struggling to update this field via an API for several weeks now.  I have read the documentation and have used the following per the documentation:

  "customfield_10112": [{"value": "value1" },{"value": "value2"}] or

  "customfield_10112": [{"id": 10156}, {"id": 10163}]

Neither of which work.  Work was done in Postman.  I confirmed that I can update other fields on the Jira ticket, just not this custom field.  I have read through various posts and tried a lot of different suggestions but to no avail.

1 answer

0 votes
Bill Sheboy
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.
May 14, 2024

Hi @Claudine Warren -- Welcome to the Atlassian Community!

Either of those syntaxes look correct, assuming they are included with the rest of an issue update call and the field can be edited: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-put

 

Have you checked the metadata to determine if your field can be updated this way?  For example, by identifying an example issue with your field and using this call:

yourJiraURL/rest/api/2/issue/exampleIssueKey?expand=editmeta

Then check which operations are available for the field.

Kind regards,
Bill

Claudine Warren May 16, 2024

@Bill Sheboy  I did the above.....here is a snippet with the custom field I am trying to update.

...

"customfield_10112": {
"required": false,
"schema": {
"type": "array",
"items": "option",
"custom": "com.atlassian.jira.plugin.system.customfieldtypes:multiselect",
"customId": 10112
},
"name": "SISLNext Account Group",
"key": "customfield_10112",
"operations": [
"add",
"set",
"remove"
],...
I assume the operations is what I am looking at to ensure it can be updated? And to answer your previous question, yes, it is in a body that will get a successful response when sent in Postman.  And I did try other fields just to be certain I could edit the record, they work fine....it is just this particular field is giving me trouble. Thanks.
Bill Sheboy
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.
May 16, 2024

Which REST API function are you calling for this message?

Just to confirm, you send the message and it shows no errors AND does not set (or update) the field?

When you checked the metadata with the example issue, did the values appear in the same structure as you expected?

Claudine Warren May 16, 2024

REST API function....may not totally understand exactly what that means, but this is my what I use to send my request.

 

https://mycompanydomain.atlassian.net/rest/api/2/issue/AGT-1986?expand=editmeta

Correct, I send the request with the custom field update and I get a successful response, just no update in Jira on that specific field.

 

The metadata yess, I see the whole list of different 'valid values' and it is what I expect.  

Another side note.  I did do a GET on a record where I updated this field in JIRA, it returned this:

  "customfield_10112": [

            {

                "self": "https://personifyhealth.atlassian.net/rest/api/2/customFieldOption/10156",

                "value": "Accordant",

                "id": "10156"

            },

            {

                "self": "https://personifyhealth.atlassian.net/rest/api/2/customFieldOption/10163",

                "value": "Centene",

                "id": "10163"

            }

        ]

 

I copied this exactly and pasted into my request to see if it would update.  Again, successful response but no update in JIRA for this specific field.

 

 

Bill Sheboy
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.
May 16, 2024

It appears you are using Edit Issue one: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-put

Sorry, I am out of suggestions on this symptom.  The syntax you originally tried for a multi-select custom field seems correct for an update using "fields" to replace the values or "update" with "set" or "add" operations.

Claudine Warren May 16, 2024

I appreciate the assist.  I will look into submitting a ticket to support.

 

Suggest an answer

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

Atlassian Community Events