Error while trying to transition a Jira issue with fields using curl

I’m trying to transition a jira Issue while updating fields within the transition. This command works to transition the issue but there are extra fields that need to be updated.

curl -u [user]:[pwd] -X POST --data "{"""transition""":{"""id""":"""11"""}}" -H "Content-Type: application/json" https://jira/rest/api/2/issue/ABC-10122/transitions

But this one throws an error

curl -u [user]:[pwd] -X POST --data "{"""transition""":{"""id""":"""11"""},"""fields""":{ """customfield_18420""":"""Yes"""}}" -H "Content-Type: application/json"  https://jira/rest/api/2/issue/ABC-10122/transitions

Error: ({"errorMessages":[],"errors":{"customfield_18420":"Could not find valid 'id' or 'value' in the Parent Option object."}})

Hi @JohnLawlor1, can you try adding value key to the JSON object you’re posting? So the post body would look something like this:

{
  "transition": {
    "id": "11"
  },
  "fields": {
    "customfield_18420": {
      "value": "Yes"
    }
  }
}

… and see if that works, or if it throws a different error?

1 Like

Perfect, that works.