We have escalation script which were working ok, but now after one custom field is set as required we need to fill it f it is empty.
custom field type is Project Picker and I tried to set values by script
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def customField = customFieldManager.getCustomFieldObjectByName("field name") // name of CF
if (!customField.getValue(issue)) {
def optionsManager = ComponentAccessor.getOptionsManager()
def fieldConfig = customField.getRelevantConfig(issue)
def option = optionsManager.getOptions(fieldConfig).find { it.value == 'Project: ACR' } // value of option
issueInputParameters.addCustomFieldValue(customField.id, option.optionId as String)
}
by some reason I cannot get match to project in def option.
what would be correct way to set project picker field ?
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.