I have a behavior that is not working -
// Behavior Server Side Script
import com.atlassian.jira.component.ComponentAccessor
if (getActionName() == "Create") {
return // not the initial action, so don't set default values
}
// set a select list value
def ProgramFld = getFieldByName("Epic Link")
def optionsManager = ComponentAccessor.getOptionsManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def customField = customFieldManager.getCustomFieldObject(ProgramFld.getFieldId())
def config = customField.getRelevantConfig(getIssueContext())
def options = optionsManager.getOptions(config)
def optionToSelect = options.find { it.value == "PRDRPTD-1" }
ProgramFld.setFormValue(optionToSelect.optionId)