Jira REST API transition: set values for child field

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

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Jira

Mission-critical battery manufacturer fulfills FAA software requirements with Commit Policy Plugin

EaglePicher Technologies is a leading manufacturer of battery systems for diverse industries like defense, aviation, space or medical. As they operate in highly regulated industries, keeping a clear ...

143 views 0 2
Read article

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