Nullpointer exception when using "ScriptRunner Listener service"

Description

*This issue has moved*

This issue has been moved permanently to Adaptavist's Product Support JIRA instance.

All existing users of this instance should have the same username on our Product Support instance. However, you will very likely need to click on the
Can't access your account link in order to reset to a new password.

We use scriptrunner listener service to clone an issue (bulidt in script) when a comment is added on a closed issue. This works fine if we Comment the issue inside Jira, but when a mail is processed by jira (JEHM) and a comment i added to a closed issue from mail. Scriptrunner buidlt in script fails with Nullpointer exception from com.onresolve.jira.groovy.canned.workflow.postfunctions.AbstractCloneIssue.getUser().

Hope someone can helt / fix the bug.

Full stacktrace:

from the invoker 'SingleParameterMethodListenerInvoker{method=public void com.onresolve.jira.groovy.listener.ScriptRunnerUber

Listener.workflowEvent(com.atlassian.jira.event.issue.IssueEvent), listener=com.onresolve.jira.groovy.listener.ScriptRunnerUberListener@3d1d623a}'.

java.lang.RuntimeException: Cannot invoke method getName() on null object

at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:54)

at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$2.run(AsynchronousAbleEventDispatcher.java:66)

at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1.execute(AsynchronousAbleEventDispatcher.java:32)

at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:60)

at com.atlassian.event.internal.EventPublisherImpl.invokeListeners(EventPublisherImpl.java:160)

at com.atlassian.event.internal.EventPublisherImpl.publish(EventPublisherImpl.java:79)

at com.atlassian.multitenant.event.DefaultPeeringEventPublisherManager.publish(DefaultPeeringEventPublisherManager.java:17)

at com.atlassian.multitenant.event.PeeringEventPublisher.publish(PeeringEventPublisher.java:23)

at com.atlassian.jira.event.issue.DefaultIssueEventManager.publishEvent(DefaultIssueEventManager.java:124)

at com.atlassian.jira.event.issue.DefaultIssueEventManager.dispatchEvent(DefaultIssueEventManager.java:102)

at com.atlassian.jira.issue.util.DefaultIssueUpdater.doUpdate(DefaultIssueUpdater.java:88)

at com.javahollic.jira.emh.service.ProcessorRunner.sendUpdates(ProcessorRunner.java:1101)

at com.javahollic.jira.emh.service.ProcessorRunner.runProcessor(ProcessorRunner.java:902)

at com.javahollic.jira.emh.service.ProcessorRunner.execute(ProcessorRunner.java:202)

at com.javahollic.jira.emh.service.EnterpriseMessageHandlerImpl.handleMessage(EnterpriseMessageHandlerImpl.java:237)

at com.javahollic.jira.emh.service.EnterpriseMessageHandlerProxy.handleMessage(EnterpriseMessageHandlerProxy.java:45)

at com.atlassian.jira.service.services.mail.MailFetcherService$1.process(MailFetcherService.java:368)

at com.atlassian.jira.service.services.mail.MailFetcherService$MessageProviderImpl.getAndProcessMail(MailFetcherService.java:271)

at com.atlassian.jira.service.services.mail.MailFetcherService.runImpl(MailFetcherService.java:356)

at com.atlassian.jira.service.services.file.AbstractMessageHandlingService.run(AbstractMessageHandlingService.java:252)

at com.atlassian.jira.service.JiraServiceContainerImpl.run(JiraServiceContainerImpl.java:61)

at com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:47)

at org.quartz.core.JobRunShell.run(JobRunShell.java:195)

at com.atlassian.multitenant.quartz.MultiTenantThreadPool$MultiTenantRunnable.run(MultiTenantThreadPool.java:72)

at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)

Caused by: java.lang.NullPointerException: Cannot invoke method getName() on null object

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

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

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

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

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

at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)

at com.onresolve.jira.groovy.canned.workflow.postfunctions.AbstractCloneIssue.getUser(AbstractCloneIssue.groovy:87) <+3>

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

at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:267)

at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)

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

at com.onresolve.jira.groovy.canned.workflow.postfunctions.AbstractCloneIssue.doScript(AbstractCloneIssue.groovy:44)

at com.onresolve.jira.groovy.canned.workflow.postfunctions.CopyIssueWithAttachments.super$2$doScript(CopyIssueWithAttachments.groovy) <+3>

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:233)

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

at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:128)

at com.onresolve.jira.groovy.canned.workflow.postfunctions.CopyIssueWithAttachments.doScript(CopyIssueWithAttachments.groovy:19)

at com.onresolve.jira.groovy.canned.workflow.postfunctions.CloneIssue.super$3$doScript(CloneIssue.groovy) <+3>

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:233)

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

at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:128)

at com.onresolve.jira.groovy.canned.workflow.postfunctions.CloneIssue.doScript(CloneIssue.groovy:81)

at com.onresolve.jira.groovy.canned.CannedScript$doScript.call(Unknown Source)

at com.onresolve.jira.groovy.CannedScriptRunner.runCannedScript(CannedScriptRunner.groovy:60)

at com.onresolve.jira.groovy.GroovyRunner.run(GroovyRunner.java:52) <+2>

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

at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSite.invoke(PojoMetaMethodSite.java:189)

at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)

at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)

at com.onresolve.jira.groovy.listener.ScriptRunnerUberListener$_workflowEvent_closure1.doCall(ScriptRunnerUberListener.groovy:48) <+2>

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:233)

at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)

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

at groovy.lang.Closure.call(Closure.java:412)

at groovy.lang.Closure.call(Closure.java:425)

at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1377)

at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1349)

at org.codehaus.groovy.runtime.dgm$149.invoke(Unknown Source)

at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)

at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)

at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)

at com.onresolve.jira.groovy.listener.ScriptRunnerUberListener.workflowEvent(ScriptRunnerUberListener.groovy:35) <+2>

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

at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:36)

... 24 more

Environment

Atlassian JIRA (v5.2.4.1#846-sha1:7ae4d02)

Assignee

Jamie Echlin

Reporter

Thomas Nakken

Labels

None

Internal Complexity

Unknown

Internal Value

Unknown

Fix versions

Affects versions

Priority

Major
Configure