Skip to content

Instantly share code, notes, and snippets.

@jbest84
Created July 28, 2016 17:43
Show Gist options
  • Save jbest84/74babd807b9770d1113aa46850b45ffc to your computer and use it in GitHub Desktop.
Save jbest84/74babd807b9770d1113aa46850b45ffc to your computer and use it in GitHub Desktop.
Jenkins Next Build Number
// Run this in Jenkins script console
def jobName = "slx/8.3.x" // Include folder for multibranch pipeline
def nextBuildNumber = 69
def job = Jenkins.getInstance().getItemByFullName(jobName, Job.class)
println(job.nextBuildNumber)
job.nextBuildNumber = nextBuildNumber
job.save()
// Credit to comment on https://support.cloudbees.com/hc/en-us/articles/216114978-How-to-set-next-build-number-in-Pipeline-job
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment