Sample Code:
import com.atlassian.jira.component.ComponentAccessor;
import com.onresolve.jira.groovy.user.FieldBehaviours;
import com.atlassian.jira.issue.customfields.option.*;
import com.atlassian.jira.issue.fields.rest.FieldTypeInfoContextImpl
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
@BaseScript FieldBehaviours fieldBehaviours
def customFieldManager = ComponentAccessor.getCustomFieldManager();
def customfield = customFieldManager.getCustomFieldObject("customfield_10300");
def customfield_config = customfield.getRelevantConfig(getIssueContext());
return customfield_config
Note 1:
When we execute the above sample code it throws the following error message. So could you please share us the inputs to resolve this error.
Error Message:
Cannot get property 'pid' on null object
java.lang.NullPointerException: Cannot get property 'pid' on null object
at com.onresolve.jira.groovy.user.FormField.getFormValue(FormField.groovy:187)
at com.onresolve.jira.groovy.user.FieldBehaviours.getIssueContext(FieldBehaviours.groovy:218)
at Script1064.run(Script1064.groovy:11)
Note 2: To analysis the root cause , i try to execute the command ctrl+J mouse over the method name getIssueContext().
It tries to launch the page
https://docs.oracle.com/javase/8/docs/api/com/onresolve/jira/groovy/user/FieldBehaviours.html
instead of the below expected one.