Hi.
i'm trying to update a few checkboxes without sucess.
I'm stuck here:
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)?
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".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.