Error while trying to update a custom field using REST API

I am trying to implement a functionality to auto close few tickets which meets a criteria. I am getting the errors mentioned below while making the API call to resolve the issue.

Command I am running:

curl -D- -u admin:admin -X POST --data @oracle_decomm_close_2 -H "Content-Type: application/json" "" 

cat oracle_decomm_close_2
"update": {
"comment":[{"add": {"body": "Automatic closure of Oracle decommission ticket"}}],
"worklog":[{"add": {"timeSpent":"1m"}}],
"customfield_14881":{"value": "NO"}
},"transition": {"id": "5"}


{"errorMessages":["Can not deserialize instance of java.util.ArrayList out of START_OBJECT token\n at [Source: com.plugenta.jiraauditor.filter.RestReadingServletRequest$1@388e8ec2; line: 1, column: 139] (through reference chain:[\"update\"])"]}


New to json. Any help on this is highly appreciated.


1 answer

This widget could not be displayed.
Alexey Matveev Community Champion Jan 05, 2018


Do you mean that the problem is with customfield_14881? Are you sure about it? Did you try to do the POST without customfield_14881? Did it work? If you are sure that the problem is withcustomfield_14881then what is customfield_14881 custom field type?

Thanks for getting back Alexey.


I am not quite sure where the problem is. I figured that customfield_14881 is required to transition the ticket status to "Resolved". It wouldnt let me close the ticket from the front end, if this field is not set.


I am not sure how to find the type of the custom field. But I did a GET on an existing ticket, and found the below for this particular custom field.

"customfield_14881": {
"id": "17533",
"self": "",
"value": "NO"


Please excuse my mistakes. Any help or guidance is appreciated.

Alexey Matveev Community Champion Jan 08, 2018

Your JSON should be like this

"update": {
"comment":[{"add": {"body": "Automatic closure of Oracle decommission ticket"}}],
"worklog":[{"add": {"timeSpent":"1m"}}]

"fields": {
    "customfield_14881":{"value": "NO"}
  },"transition": {"id": "5"}

Tried that.


I get HTTP/1.1 500 Internal Server Error


Can I enable additional logging to see specific errors?

Alexey Matveev Community Champion Jan 08, 2018

Have a look in your atlassian-jira.log. It should work. The problem was that

"customfield_14881":{"value": "NO"} was in the update parameter. But it must be in the fields parameter. Aslo I supposed that your custom field is a single select

Thanks Alexey.


Unfortunately I dont have access to the application logs. I will keep looking to get them.


Adding the custom field change to fields parameter still hasn't worked.

Alexey Matveev Community Champion Jan 08, 2018

What is the error?

I just get this when i execute the curl command.


{"errorMessages":["Internal server error"],"errors":{}}

The custom field is indeed single select. From the front end i see the possible options are YES/NO

Alexey Matveev Community Champion Jan 08, 2018

Try to install Jira REST API browser add-on(it is free) and check it there. You can query all REST API functions there. Have a look what will be the error there.

Thanks Alexey. Turns out the id I gave in the transition was incorrect.


It worked after I gave the right one.


Thanks for your help.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

165 views 1 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you