I have to set the value for a cascading custom field where parent value depends on other custom field value.
I used a Custom script post-function (ScriptRunner) but it doesen't work:
// other field value (single select list)
def cfOther = ComponentAccessor.customFieldManager.getCustomFieldObject("customfield_11614")
String other = cfOther.getValue(issue).toString()
// cascading cf to set
def cfField = ComponentAccessor.customFieldManager.getCustomFieldObject("customfield_11616")
def fieldConfig = cfField.getRelevantConfig(issue)
def option = optionsManager.getOptions(fieldConfig).find {it.value == other}
issue.setCustomFieldValue(cfField, [option.getOptionId(), option.childOptions[0].getOptionId()])
someone can help?