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

API Update customfield checkbox

Fernando Simões
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 19, 2022

Hi.

i'm trying to update a few checkboxes without sucess.

Untitled.png

Untitled.png

I'm stuck here:

{
  "fields":{
   "customfield_13304": [{"value""Yes" }, {"value""Yes" }]
               }
}

The response is 204, but only the first option is being ticked.

Can someone help please?

2 answers

0 votes
Florian Bonniec
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 19, 2022

Hi @Fernando Simões 

You send an array with 2 times the same value.

 

Regards

0 votes
David Bakkers
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.
December 19, 2022 edited

Hello @Fernando Simões 

I've just re-read your question and got a bit confused.

Since you haven't advised which REST API endpoint you're using or the actual request you are sending, only some JSON, it's not clear if you are trying to change the value of the checkbox options ('Yes" and "No") or the state of the options (ticked or not ticked)?

Untitled.png

A checkbox field with two options with the same value of 'Yes', both of which could be enabled (ticked), wouldn't make any sense :-)

If you want to set the state of both the options to be ticked, you have to reference both their values, like this:

{
"fields":{
"customfield_13304": [
{
"value": "Yes"
},
{
"value": "No"
}
]
}
}

This is effectively saying "If there are two possible matching options, Yes and No, set them both"

The logic of unticking an option is completely bizzare!! There is no way to direct a single option to be unticked, as far as I can work out, except to set all the other possible option choices to one value. IE, to untick the No option in your example, would require:

{
"fields":{
"customfield_13304": [
{
"value": "Yes"
},
{
"value": "Yes"
}
]
}
}

 ... hence the problem you encountered, as you were effectively saying "If there is a Yes option, set it for both possible choices".

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, team '25, conference, certifications, bootcamps, training experience, anaheim ca,

Want to make the most of Team ‘25?

Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.

Learn more
AUG Leaders

Upcoming Jira Events