refactorsaurusrex
5/22/2017 - 11:07 PM

Jenkins Pipeline: How to get the status of the previous build

Jenkins Pipeline: How to get the status of the previous build

node('whatever') {
  stage('blah') {
    echo currentBuild.getPreviousBuild().result
  }
}

// ref: https://support.cloudbees.com/hc/en-us/articles/217591038-How-to-Iterate-Through-the-Last-Successful-Builds-in-Pipeline-Job