1

I have a Linux Jenkins master and one windows slave. I want all the current projects build numbers to be reset, and next time when I start the build it should start from number 1.

How to do that in Linux master? Please provide me the steps to reset build numbers?

jww
  • 97,681
  • 90
  • 411
  • 885
Shimith
  • 87
  • 1
  • 10
  • 1
    Possible duplicate of [Changing Jenkins build number](https://stackoverflow.com/questions/19645430/changing-jenkins-build-number) – Software2 Jun 19 '17 at 18:13

1 Answers1

1

You could use the groovy script console as explained here.

Go into your master Jenkins instance http://your_jenkins_url/script and run this:

item = Jenkins.instance.getItemByFullName("Your Project Name")
//THIS WILL REMOVE ALL BUILD HISTORY
item.builds.each() { build ->
  build.delete()
}
item.updateNextBuildNumber(1)

I've tested it in my local setup and it worked:

run_groovy_script

Results:

results

Miguel Ortiz
  • 1,412
  • 9
  • 21