Hi,
I'm using the script below to retrieve checkbox custom field values.
However, when I search the log I see that although I selected one option from the checkboxes, I receive a null value in the script.
Please help me to understand what I'm doing wrong?!
//deal Deal Types field
CustomField dealDealTypes = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("deal Deal Types");
List<Option> options = (List<Option>)dealDealTypes.getValue(issue);
def ss = options.toString()
logd.debug(" options: " + options)
logd.debug(" ss: " + ss)
Thanks!
Hello,
Where do you execute this script?
Try to do like this:
CustomField dealDealTypes = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("deal Deal Types");
def options = issue.getCustomFieldValue(dealDealTypes);
def ss = options.toString()
logd.debug(" options: " + options)
logd.debug(" ss: " + ss)
Thanks for your answer but now I receive this message in the log:
2018-08-14 09:38:56,028 ERROR [workflow.ScriptWorkflowFunction]: Script function failed on issue: null, actionId: 1, file: <inline script> java.lang.NullPointerException at com.atlassian.jira.issue.IssueImpl.getCustomFieldValue(IssueImpl.java:898) at com.atlassian.jira.issue.Issue$getCustomFieldValue$3.call(Unknown Source) at Script349.run(Script349.groovy:29)
I'm running this script in workflow validator.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is line 29 in your script?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.