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

Wrong build.result in post action success in pipeline

XMLWordPrintable

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

       

      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"

       

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

              Created:
              Updated:
              Resolved: