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

unsuccessful block is triggered for successful runs

    Details

    • Similar Issues:
    • Released As:
      pipeline-model-definition 1.3.5

      Description

      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

        

       

        Attachments

          Issue Links

            Activity

            kutzi kutzi created issue -
            kutzi kutzi made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-49997 [ JENKINS-49997 ]
            abayer Andrew Bayer made changes -
            Link This issue is duplicated by JENKINS-55265 [ JENKINS-55265 ]
            Hide
            dnusbaum Devin Nusbaum added a comment -

            I noticed this as well in https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/313, (the main point of that PR is not related, I just happened to see it) and added a fix for it there. See https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/313#discussion_r259517064 specifically.

            Show
            dnusbaum Devin Nusbaum added a comment - I noticed this as well in https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/313 , (the main point of that PR is not related, I just happened to see it) and added a fix for it there. See https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/313#discussion_r259517064 specifically.
            dnusbaum Devin Nusbaum made changes -
            Assignee Andrew Bayer [ abayer ] Devin Nusbaum [ dnusbaum ]
            dnusbaum Devin Nusbaum made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            dnusbaum Devin Nusbaum made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            dnusbaum Devin Nusbaum made changes -
            Remote Link This issue links to "jenkinsci/pipeline-model-definition-plugin#313 (Web Link)" [ 22419 ]
            dnusbaum Devin Nusbaum made changes -
            Status In Review [ 10005 ] Fixed but Unreleased [ 10203 ]
            Resolution Fixed [ 1 ]
            Hide
            dnusbaum Devin Nusbaum added a comment -

            The fix for this issue was released in version 1.3.5 of the Pipeline: Declarative Plugin.

            Show
            dnusbaum Devin Nusbaum added a comment - The fix for this issue was released in version 1.3.5 of the Pipeline: Declarative Plugin.
            dnusbaum Devin Nusbaum made changes -
            Status Fixed but Unreleased [ 10203 ] Resolved [ 5 ]
            Released As pipeline-model-definition 1.3.5
            Hide
            bitwiseman Liam Newman added a comment -

            Bulk closing resolved issues.

            Show
            bitwiseman Liam Newman added a comment - Bulk closing resolved issues.
            bitwiseman Liam Newman made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

              People

              • Assignee:
                dnusbaum Devin Nusbaum
                Reporter:
                kutzi kutzi
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: