Hi,
I have a code that takes a custom field value.
This custom field is 1 checkbox- "Yes".. If it chosen, the value is 'Yes' and if it doesn't, the value is null.
I use those lines:
def internal = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Internal Feature");
def selectedValues1 = internal.getValue(featureIssue);
def selectedValues2 = internal.getValue(issue);
When the value is null, The code didn't run, and send this error:
Script function failed on event: com.atlassian.jira.event.issue.IssueEvent, file: <inline script>
java.lang.NullPointerException
at com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType.getValueFromIssue(AbstractMultiCFType.java:150)
at com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType.getValueFromIssue(AbstractMultiCFType.java:39)
at com.atlassian.jira.issue.fields.ImmutableCustomField.getValue(ImmutableCustomField.java:350)
at com.atlassian.jira.issue.fields.CustomField$getValue$1.call(Unknown Source)
at Script1099.run(Script1099.groovy:52)
Can someone help me to understand how can I do it ?
Tnx !