Following some posts I've seen, I am using the Python REST API to create a new issue and passing this as part of the dict of the fields:
'customfield_11585': { # 'my_field' - a cascaded selection field
'value': 'fu', # parent value: 'fu' (id=26637)
'child': {
'id': '26792' # child value: 'bar' (id=26792)
}
},
This results in error 400: "Specify a valid child option 'id' for my_field".
Next I tried to use 'name' instead of 'id' and I get a different 400 error:
"Specify a valid child option 'id' or 'name' for my_field".
Next I tried to use 'value', and I get this error:
"Specify a valid child option 'name' for my_field".
I also tried to use the option name ('bar') instead of the id, but to no avail.
The only thing that does succeed is when I pass an empty child, like this:
'customfield_11585': {
'value': 'fu',
'child': None
},
So I know that the REST API call to set the field with the parent works, but I can't set the child option.
The documentation does not provide an example of setting a cascaded field:
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-post