How to set next build number in Pipeline job?

Article ID:216114978
1 minute readKnowledge base


How do I set the next build number of a Pipeline job?


You can run the following from the Script Console ($JENKINS_URL/script):

def job = Jenkins.instance.getItemByFullName("folderName/my-pipeline-job")
job.nextBuildNumber = 10

Replace folderName/my-pipeline-job with your folder/job name and 10 with the desired next build number.