Issue
How do I set the next build number of a Pipeline job?
Environment
- CloudBees CI (CloudBees Core) on modern cloud platforms - Managed Master
- CloudBees CI (CloudBees Core) on traditional platforms - Client Master
- CloudBees Jenkins Platform - Client Master
- Jenkins LTS
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.
4 Comments