Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,364,733
Community Members
 
Community Events
168
Community Groups

How to update a checklist custom field and check off desired values?

Hello,

I am trying to update my custom field checklist using REST API and check off the desired values according to a specific selected value id. I've looked at documentation and don't get any errors in with my Python JSON format, but it does not check off anything in my checklist or update my issue at all.

 

checklist field ID: 10117

selectedValueID: 10224

 

Here's my Python code:

 

"update": {
  "fields": {
    "customfield_10117" : [
          {
               "set": [
                      {
                           "name": "Print welcome packet.",
                           "checked": "true",
                           "mandatory": "false",
                           "option": "true",
                           "id": "10224"
                        }
                  ]
             }
         ]
     },
}

 

1 answer

Hi Alex,

The format of the data looks like our "Checklist for Jira" Server/DC REST format, albeit from an older version (v4), because "option" is no longer a valid property.

Your post indicates you are on Cloud, so I am not sure which App and which Jira install you are using.

Here's some information that could help:

- Up to date documentation for Checklist for Jira (Server/DC).

- If you are using Checklist for Jira on Cloud, unfortunately there is no REST API to update the value at the moment.

- If you are using Issue Checklist on Cloud, here's the documentation for it.

Let me know if this helps!

Have a nice day

Thanks! Actually, "option" was not the problem. My issue was not updating for a few reason:

1. When having "update" it did not work, so remove it.

2. "Set" also seemed to be an issue, so removing it worked.

3. "Mandatory" was checked "false", which tells Jira it is not necessary to update.

Once I removed these in my JSON, everything updated.

Good to see it worked out :)

After taking a closer look, I see why you had to remove "update" and "set", because it's synonym to "fields".

When using Jira REST API, you either use "update" or "fields", not both at the same time.

"fields" is a shortcut for doing an "update" with "set" operation. Example:

"fields": {
"my-field": "value"
}

is the same as doing:

"update": {
"my-field": [
{
"set": "value"
}
]

The "update" method becomes interesting if you want to do something else than "set", which overwrites the field value completely. If you wanted to add a value to the existing value, you would do:

"update": {
"my-field": [
{
"add": "value"
}
]
}

 Have a nice day!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS

Atlassian Community Events