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

Send custom email preview fails when using config map

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1.3.20, 4.3.11
    • Component/s: None
    • Labels:
    • Sprint:
      Sprint 27 - Ends Nov 1
    • Critical Points:
      0.3

      Description

      This only affects the preview when configuring the template using the config map. If you save the listener when it is run it will find the bindings and work.

      To reproduce:

      • Setup send custom email listener with the "condition configuration section" as:
        config.summary = issue.summary
        true
        
      • Then set the email template to be:
        <h1>${summary}</h1>
        
        <table style="width:100%">
          <tr>
            <th>Firstname</th>
            <th>Lastname</th> 
            <th>Age</th>
          </tr>
          <tr>
            <td>Jill</td>
            <td>Smith</td> 
            <td>50</td>
          </tr>
          <tr>
            <td>Eve</td>
            <td>Jackson</td> 
            <td>94</td>
          </tr>
        </table>
        
      • Then click preview you get the following exception:
        ERROR 2016-10-07 16:37:21,283 [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: No such property: summary for class: groovy.lang.Binding
        groovy.lang.MissingPropertyException: No such property: summary for class: groovy.lang.Binding
        	at groovy.lang.Binding.getVariable(Binding.java:63)
        	at groovy.lang.Binding.getProperty(Binding.java:105)
        	at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:172)
        	at groovy.lang.Closure.getPropertyTryThese(Closure.java:324)
        	at groovy.lang.Closure.getPropertyDelegateFirst(Closure.java:314)
        	at groovy.lang.Closure.getProperty(Closure.java:299)
        	at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:50)
        	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:307)
        	at groovy.tmp.templates.GStringTemplateScript25$_getTemplate_closure1.doCall(GStringTemplateScript25.groovy:2)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        	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:93)
        	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
        	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1021)
        	at groovy.lang.Closure.call(Closure.java:426)
        	at groovy.lang.Closure$WritableClosure.writeTo(Closure.java:856)
        	at groovy.lang.Closure$WritableClosure.toString(Closure.java:982)
        	at sun.reflect.GeneratedMethodAccessor997.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.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
        	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:71)
        	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
        	at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail$_buildMarkup_closure16$_closure27$_closure35.doCall(SendCustomEmail.groovy:774)
        	at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail$_buildMarkup_closure16$_closure27$_closure35.doCall(SendCustomEmail.groovy)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        	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:93)
        	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
        	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1021)
        	at groovy.lang.Closure.call(Closure.java:426)
        	at groovy.lang.Closure.call(Closure.java:420)
        	at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:147)
        	at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:67)
        	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeOnDelegationObjects(ClosureMetaClass.java:446)
        	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:369)
        	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1021)
        	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:812)
        	at groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:46)
        	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeOnDelegationObjects(ClosureMetaClass.java:430)
        	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:369)
        	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1021)
        	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
        	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:174)
        	at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail$_buildMarkup_closure16$_closure27.doCall(SendCustomEmail.groovy:770)
        	at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail$_buildMarkup_closure16$_closure27.doCall(SendCustomEmail.groovy)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        	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:93)
        	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
        	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1021)
        	at groovy.lang.Closure.call(Closure.java:426)
        	at groovy.lang.Closure.call(Closure.java:420)
        	at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:147)
        	at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:67)
        	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeOnDelegationObjects(ClosureMetaClass.java:446)
        	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:369)
        	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1021)
        	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
        	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
        	at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail$_buildMarkup_closure16.doCall(SendCustomEmail.groovy:766)
        	at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail$_buildMarkup_closure16.doCall(SendCustomEmail.groovy)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        	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:93)
        	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
        	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1021)
        	at groovy.lang.Closure.call(Closure.java:426)
        	at groovy.lang.Closure.call(Closure.java:420)
        	at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:147)
        	at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:67)
        	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
        	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
        	at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail.buildMarkup(SendCustomEmail.groovy:736)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        	at java.lang.reflect.Method.invoke(Method.java:498)
        	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
        	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
        	at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmail.getDescription(SendCustomEmail.groovy:729)
        	at com.onresolve.scriptrunner.canned.CannedScript$getDescription$2.call(Unknown Source)
        	at com.onresolve.scriptrunner.runner.ScriptRunnerImpl.getPreviewInternal(ScriptRunnerImpl.groovy:484)
        	at com.onresolve.scriptrunner.runner.ScriptRunnerImpl$getPreviewInternal$5.callCurrent(Unknown Source)
        	at com.onresolve.scriptrunner.runner.ScriptRunnerImpl.getPreview(ScriptRunnerImpl.groovy:476)
        	at com.onresolve.scriptrunner.runner.rest.AbstractRestEndpoint.previewOrExecCanned(AbstractRestEndpoint.groovy:184)
        	at com.onresolve.scriptrunner.runner.rest.jira.ListenersRestEndpoint.previewCanned(ListenersRestEndpoint.groovy:179)
        

      It seems like we need to add these parameters to the binding for the preview to work.

        Attachments

          Activity

            People

            Assignee:
            jechlin Jamie Echlin
            Reporter:
            amarkham Adam Markham
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: