Groovy Script Runner issue

We have created a workflow that relies heavily on the send custom email post function functionality that script runner provides.

 

In the To Issue Fields: I specify a custom field which is a multi-user selector field and get the below error no matter if I specify one user or multiple.

v3.0.7 doesn't fix it.

Below the stack dump generated in logs when the post function is executed.

Exception in thread "Thread-71" java.lang.NullPointerException: Cannot invoke method split() on null object

        at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:88)

        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)

        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)

        at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:32)

        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)

        at java_lang_String$split$6.call(Unknown Source)

        at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail.getAddressesFromFields(SendCustomEmail.groovy:529)

        at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail$getAddressesFromFields$3.callCurrent(Unknown Source)

        at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail.getAllToAddresses(SendCustomEmail.groovy:460)

        at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail$getAllToAddresses$2.callCurrent(Unknown Source)

        at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail.constructMail(SendCustomEmail.groovy:298)

        at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail$constructMail.callCurrent(Unknown Source)

        at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail.sendMail(SendCustomEmail.groovy:317)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

        at java.lang.reflect.Method.invoke(Unknown Source)

        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)

        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)

        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)

        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:78)

        at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail.this$dist$invoke$1(SendCustomEmail.groovy)

        at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail$1.methodMissing(SendCustomEmail.groovy)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

        at java.lang.reflect.Method.invoke(Unknown Source)

        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)

        at groovy.lang.MetaClassImpl.invokeMissingMethod(MetaClassImpl.java:933)

        at groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1256)

        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1209)

        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)

        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)

        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)

        at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail$1.run(SendCustomEmail.groovy:354)

        at java.lang.Thread.run(Unknown Source)

3 answers

This widget could not be displayed.

... but wait, there's no close :) within the new Answers

This widget could not be displayed.
Peter Bengov Community Champion Dec 15, 2014

Are you sure the variable you using the split() function on is mandatory? Looks like the value is empty, which disables ability to run split() on your variable.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

155 views 2 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you