How to set next build number in Pipeline job?

Article ID:216114978
1 minute readKnowledge base

Issue

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

Resolution

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

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

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