Jira REST API transition: set values for child field

Emil Vakhitov October 24, 2017

Hi!

I am trying to do an issue transition using Python jira package.

jira_auth.transition_issue(issue, '241', customfield_11470 = {'value': 'Инициатива кандидата'})

The issue object is correct: with jira_auth.transitions(issue) I can get all the transitions all right (in fact, there's only one transition available).

However, the transition doesn't occur, and I may guess why: there's one more field which has to be filled, which is shown explicitly when I attempt to do the transition manually.

From the result of transition.fields method for the issue above I conclude that the second field is like a "child field" to customfield_11470:

 "fields": {
"customfield_11470": {
"required": false,
"schema": {
"type": "array",
"items": "string",
"custom": "com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect",
"customId": 11470
},
"name": "HR Rep. Reason",
"operations": [
"set"
],
"allowedValues": [
{
"self": "https://hr-test.glowbyteconsulting.com/rest/api/2/customFieldOption/12540",
"value": "Инициатива GBC",
"id": "12540",
"children": [
{
"self": "https://hr-test.glowbyteconsulting.com/rest/api/2/customFieldOption/12542",
"value": "Из списка отложенных",
"id": "12542"
},
{
"self": "https://hr-test.glowbyteconsulting.com/rest/api/2/customFieldOption/12543",
"value": "Ранее отверг JO",
"id": "12543"
}
]
},
{
"self": "https://hr-test.glowbyteconsulting.com/rest/api/2/customFieldOption/12541",
"value": "Инициатива кандидата",
"id": "12541",
"children": [
{
"self": "https://hr-test.glowbyteconsulting.com/rest/api/2/customFieldOption/12548",
"value": "Обновил резюме",
"id": "12548"
},
{
"self": "https://hr-test.glowbyteconsulting.com/rest/api/2/customFieldOption/12549",
"value": "Вышел на связь с GBC",
"id": "12549"
}
]
}
]
}
}

And I haven't found any name for this second field like custom_#####.

 

Q: How should I rewrite transition_issue method call so that the second field would also be filled?

1 answer

1 accepted

1 vote
Answer accepted
Emil Vakhitov October 24, 2017

Found it. Actually, the first and the second fields I've mentioned above are one field customfield_11470 of type cascadingselect.

The procedure of setting its and its child's values is pretty the same as updating such a field:

jira_auth.transition_issue(issue, '241',
fields = {
'customfield_11470': {
'value' : 'Инициатива кандидата',
'child': {'value': 'Вышел на связь с GBC'}
}
}
)

This answer helped me.

Suggest an answer

Log in or Sign up to answer