Uploaded image for project: 'SR for Jira - Development'
  1. SR for Jira - Development
  2. SRJIRA-5213

Send a custom email (non-issue events) error for event - ServiceDeskCommentEvent

    Details

    • Type: Bug
    • Status: Triage
    • Priority: High
    • Resolution: Unresolved
    • Affects Version/s: 6.18.0, 6.19.0, 6.20.0, 6.21.0, 6.22.0, 6.23.0
    • Fix Version/s: None
    • Component/s: Listeners
    • Labels:
      None
    • Critical Points:
      1

      Description

      Steps to Reproduce

      1. Add a scriptRunner Listener type: 'Send a custom email (non-issue events)'.
      2. Select the event 'ServiceDeskCommentEvent'.
      3. Add return true or "" in the condition and configuration.

      Expected Behaviour

      User is able to send email notification when comment added through the service desk when returning true in the condition and configuration.

      Actual Behaviour

      Unable to send email notification when comment added through the service desk when returning true in the condition and configuration.

      Workaround

      No value or an empty condition and configuration able to make it work.

      Additional Info

      ScriptRunner is incorrectly assuming that it will get an issue event but ServiceDeskCommentEvent does not extend IssueEvent.

      Logs

      2021-04-14 05:15:29,206 ERROR [runner.AbstractScriptListener]: *************************************************************************************
      2021-04-14 05:15:29,207 ERROR [runner.AbstractScriptListener]: Script function failed on event: com.atlassian.servicedesk.internal.comment.event.ServiceDeskCommentEventImpl, script: com.onresolve.scriptrunner.canned.jira.workflow.listeners.SendCustomEmailForNonIssueEvent
      org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'ServiceDeskCommentEventImpl{checkedUser=CheckedUserImpl{delegate=a(JIRAUSER10000), i18nHelper=com.atlassian.jira.i18n.BackingI18n@41f83d0c}, issue=DC-1, comment=ServiceDeskCommentImpl{comment=com.atlassian.jira.issue.comments.CommentImpl@ef1a88e4, attachments=[], isPublic=true}, createdEvent=true, eventTime=Wed Apr 14 05:15:28 UTC 2021, partOfIssueChange=false, sendMail=true}' with class 'com.atlassian.servicedesk.internal.comment.event.ServiceDeskCommentEventImpl' to class 'com.atlassian.jira.event.issue.IssueEvent'
      	at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.continueCastOnSAM(DefaultTypeTransformation.java:415)
      	at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.continueCastOnNumber(DefaultTypeTransformation.java:329)
      	at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToType(DefaultTypeTransformation.java:243)
      	at org.codehaus.groovy.runtime.DefaultGroovyMethods.asType(DefaultGroovyMethods.java:17156)
      	at org.codehaus.groovy.runtime.dgm$54.doMethodInvoke(Unknown Source)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
      	at org.codehaus.groovy.runtime.InvokerHelper.invokePojoMethod(InvokerHelper.java:999)
      	at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:990)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:180)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.asType(ScriptBytecodeAdapter.java:603)
      	at com.onresolve.scriptrunner.canned.jira.utils.ConditionUtils.setupBinding(ConditionUtils.groovy:154)
      	at com.onresolve.scriptrunner.canned.jira.utils.ConditionUtils$setupBinding.callStatic(Unknown Source)
      	at com.onresolve.scriptrunner.canned.jira.utils.ConditionUtils.processConditionAndContext(ConditionUtils.groovy:62)
      	at sun.reflect.GeneratedMethodAccessor5631.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
      	at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.invoke(StaticMetaMethodSite.java:44)
      	at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.call(StaticMetaMethodSite.java:89)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:151)
      	at com.onresolve.scriptrunner.workflow.DefaultWorkflowScriptExecutor.processConditionAndContextInternal(DefaultWorkflowScriptExecutor.groovy:36)
      	at sun.reflect.GeneratedMethodAccessor5616.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:190)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:58)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:63)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:184)
      	at com.onresolve.scriptrunner.workflow.DefaultWorkflowScriptExecutor.processConditionAndContext(DefaultWorkflowScriptExecutor.groovy:17)
      	at com.onresolve.scriptrunner.workflow.WorkflowScriptExecutor$processConditionAndContext.call(Unknown Source)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
      	at com.onresolve.scriptrunner.workflow.WorkflowScriptExecutor$processConditionAndContext.call(Unknown Source)
      	at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.mail.AbstractSendCustomEmail.constructMailWithConditionResult(AbstractSendCustomEmail.groovy:211)
      	at com.onresolve.scriptrunner.canned.jira.workflow.listeners.SendCustomEmailForNonIssueEvent.super$4$constructMailWithConditionResult(SendCustomEmailForNonIssueEvent.groovy)
      
      • Annotated screenshots / recordings¬†

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            amustapha Amir Mustapha
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: