• Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • build-pipeline-plugin
    • Jenkins 2.13, Pipeline 2.2.

      I am expecting that the following simple pipeline script finishes with status SUCCESS. Instead, it fails:

      print "Setting result to FAILURE"
      currentBuild.result = 'FAILURE'
      
      print "Setting result to SUCCESS"
      currentBuild.result = 'SUCCESS'

          [JENKINS-36598] Unable to manipulate build result as expected

          Joost created issue -
          Joost made changes -
          Description Original: I am expecting that the following simple pipeline script finished with status SUCCESS. Instead, it fails:

          {{print "Setting result to FAILURE"
          currentBuild.result = 'FAILURE'

          print "Setting result to SUCCESS"
          currentBuild.result = 'SUCCESS'}}
          New: I am expecting that the following simple pipeline script finished with status SUCCESS. Instead, it fails:

          print "Setting result to FAILURE"
          currentBuild.result = 'FAILURE'

          print "Setting result to SUCCESS"
          currentBuild.result = 'SUCCESS'
          Joost made changes -
          Description Original: I am expecting that the following simple pipeline script finished with status SUCCESS. Instead, it fails:

          print "Setting result to FAILURE"
          currentBuild.result = 'FAILURE'

          print "Setting result to SUCCESS"
          currentBuild.result = 'SUCCESS'
          New: I am expecting that the following simple pipeline script finishes with status SUCCESS. Instead, it fails:

          print "Setting result to FAILURE"
          currentBuild.result = 'FAILURE'

          print "Setting result to SUCCESS"
          currentBuild.result = 'SUCCESS'
          Joost made changes -
          Description Original: I am expecting that the following simple pipeline script finishes with status SUCCESS. Instead, it fails:

          print "Setting result to FAILURE"
          currentBuild.result = 'FAILURE'

          print "Setting result to SUCCESS"
          currentBuild.result = 'SUCCESS'
          New: I am expecting that the following simple pipeline script finishes with status SUCCESS. Instead, it fails:

          {noformat}print "Setting result to FAILURE"
          currentBuild.result = 'FAILURE'

          print "Setting result to SUCCESS"
          currentBuild.result = 'SUCCESS'{noformat}

          Joost added a comment -

          Joost added a comment - I guess this is as expected: https://github.com/jenkinsci/jenkins/blob/213363d387736874f1d14d83e57347f757f3ed4f/core/src/main/java/hudson/model/Run.java#L462
          Joost made changes -
          Resolution New: Not A Defect [ 7 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 173319 ] New: JNJira + In-Review [ 210211 ]

            Unassigned Unassigned
            jrkoiter Joost
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: