• Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • email-ext-plugin
    • None
    • Jenkins 2.60.3

      Trying to use the emailext pipeline step, with the presendScript argument. Step and traceback are further down.

      Seems to complain that it can't get the result property off of the build object. Isn't build supposed to be an included item in the presend script?

      emailext attachLog: true,
      body: 'You can see the console output at $BUILD_URL.',
      compressLog: true,
      recipientProviders: [[$class: 'CulpritsRecipientProvider'],
      [$class: 'DevelopersRecipientProvider']],
      presendScript: '''if (build.result.toString().equals("FAILURE"))

      { msg.addHeader("X-Priority", "1 (Highest)"); msg.addHeader("Importance", "High"); } cancel = build.result.toString().equals("ABORTED");''', subject: 'Final status for Build # $BUILD_NUMBER of $PROJECT_NAME is $BUILD_STATUS!', to: 'bcl@nclasters.org' }

      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] emailext
      Request made to compress build log
      java.lang.NullPointerException: Cannot get property 'result' on null object
      at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:60)
      at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:174)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:456)
      at org.kohsuke.groovy.sandbox.impl.Checker$6.call(Checker.java:284)
      at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:286)
      at org.kohsuke.groovy.sandbox.impl.Checker$checkedGetProperty$1.callStatic(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:56)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:194)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:230)
      at Script1.run(Script1.groovy:1)
      at hudson.plugins.emailext.ExtendedEmailPublisher.executeScript(ExtendedEmailPublisher.java:623)
      at hudson.plugins.emailext.ExtendedEmailPublisher.executePresendScript(ExtendedEmailPublisher.java:573)
      at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:456)
      at hudson.plugins.emailext.EmailExtStep$EmailExtStepExecution.run(EmailExtStep.java:224)
      at hudson.plugins.emailext.EmailExtStep$EmailExtStepExecution.run(EmailExtStep.java:163)
      at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
      at hudson.security.ACL.impersonate(ACL.java:260)
      at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:748)

          [JENKINS-46485] Pre-send script not working in extemail step

          Brent Laster created issue -
          Alex Earl made changes -
          Resolution New: Not A Defect [ 7 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]

            davidvanlaatum David van Laatum
            bclaster Brent Laster
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: