Hi all,
I'm trying to build an Initializer script in Behaviours that when the create issue (so should work with an issue create screen) window is opened (from the customer portal) reads the current Customer Request Type and hides/shows some fields. I'm having troubles in fetching the value of Customer Reuqest Type field. So far I have the current code:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def optionsManager = ComponentAccessor.getOptionsManager()
def customField = customFieldManager.getCustomFieldObjectByName("Customer Request Type")
log.info("customField: " + customField)
def fieldConfig = customField.getRelevantConfig(getIssueContext())
def options = optionsManager.getOptions(fieldConfig)
log.info("options: " + options)
but at this stage it doesn't deliver any value in options when I open create issue window from customer portal:
2019-07-16 15:19:08,664 /rest/scriptrunner/behaviours/latest/jsd/jsd/validatorsByPid.json [c.o.j.groovy.user.FieldBehaviours] options: []
2019-07-16 15:19:08,663 /rest/scriptrunner/behaviours/latest/jsd/jsd/validatorsByPid.json [c.o.j.groovy.user.FieldBehaviours] customField: Customer Request Type
Any help?