Erros while performing a transition of a jira issue while updating custom fields

John Lawlor May 20, 2024

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."}})

If I look at https://jira/rest/api/2/issue/ABC-10122/transitions in a browser there are two options: id: 11 = Submit or id: 41 - Cancel

https://jira/rest/api/2/issue/ABC-10122/transitions?expand=transitions.fields - Shows me all the extra fields like:

"customfield_18420": {
"required": false,
"schema": {
"type": "option",
"custom": "com.atlassian.jira.plugin.system.customfieldtypes:select",
"customId": 18420
},
"name": "Update?",
"fieldId": "customfield_18420",
"operations": [
"set"
],
"allowedValues": [
{
"self": "https://dev-jira/rest/api/2/customFieldOption/21760",
"value": "No",
"id": "21760"
},
{
"self": "https://dev-jira/rest/api/2/customFieldOption/21761",
"value": "Yes",
"id": "21761"
}
]
},

0 answers

Suggest an answer

Log in or Sign up to answer