Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-47348

Wrong build.result in post action success in pipeline

    XMLWordPrintable

Details

    Description

       

      Jenkinsfile

      pipeline {
        agent any
      
        stages {
          ...
        }
        post {
          success {
            emailext (
              attachLog: true,
              subject: "\$DEFAULT_SUBJECT",
              body: "\${JELLY_SCRIPT, template=\"managed:JellyEmailTemplate\"}",
              recipientProviders: [[$class: 'DevelopersRecipientProvider'], [$class:'RequesterRecipientProvider']]
            )
          }
          failure {
            emailext (
              attachLog: true,
              subject: "\$DEFAULT_SUBJECT",
              body: "\${JELLY_SCRIPT, template=\"managed:JellyEmailTemplate\"}",
              recipientProviders: [[$class: 'DevelopersRecipientProvider'], [$class: 'RequesterRecipientProvider']]
            )
          }
        }
      }

       

       

      JELLY_SCRIPT

       

      <?jelly escape-by-default='true'?>
      <j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define">
      <html>
        <head>
          <title>${project.name}</title>
        </head>
        <body>
      
          <b>BUILD ${build.result} ${build.getBuildStatusUrl()}</b>
          <j:if test="${build.isBuilding()}">IS BUILDING!!!!!!</j:if>
        </body>
      </html>

       

       

      The plugin generates body in progress state.

       

      On failure it makes right build.result === FAILURE

       

      I'd like to have build.result === SUCCESS on post action "success"

       

      Attachments

        Issue Links

          Activity

            In my opinion this is not a bug in the email-ext plugin so much but in the way jenkins pipelines work, but I have posted on the developer mailing list asking

            https://groups.google.com/d/msg/jenkinsci-dev/LmpVeFYYBIA/dhpByRdSAAAJ

             

            davidvanlaatum David van Laatum added a comment - In my opinion this is not a bug in the email-ext plugin so much but in the way jenkins pipelines work, but I have posted on the developer mailing list asking https://groups.google.com/d/msg/jenkinsci-dev/LmpVeFYYBIA/dhpByRdSAAAJ  
            basil Basil Crow added a comment -

            As described in the previous comment, this problem is not specific to the Email Extension plugin but is rather a general problem for all Pipeline jobs. See also JENKINS-54477.

            basil Basil Crow added a comment - As described in the previous comment, this problem is not specific to the Email Extension plugin but is rather a general problem for all Pipeline jobs. See also JENKINS-54477 .

            People

              Unassigned Unassigned
              artemkaint Artem Soltynskiy
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: