unsuccessful block is triggered for successful runs

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • pipeline-model-definition 1.3.5

      The post-unsuccessful block of my declarative pipeline is triggered even if the build is successful!

      Excerpt from my Jenkinsfile

      pipeline {
        stages { ... }
        post { 
          always { ... }
          success { ... }
          unsuccessful {
            script {
              echo "Build results: ${currentBuild.result} - ${currentBuild.currentResult}"
              ...
            }
          }
        }
      }
         

      And I can see `Build results: SUCCESS - SUCCESS` in the pipeline output - and the other steps of the unsuccessful block executed as well, of course

        

       

            Assignee:
            Devin Nusbaum
            Reporter:
            kutzi
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: