How to reset build number in jenkins

0 votes

Hi Team,

I have one Job in Jenkins. Every time I run the Job, I am getting one new build number. How can I reset the build number in Jenkins?

Oct 24, 2020 in Jenkins by akhtar
• 38,170 points
344 views

1 answer to this question.

0 votes

Hi@akhtar,

You can do this task with the groovy script. You need to go to your script Window and enter the below code.

item = Jenkins.instance.getItemByFullName("your-job-name-here")
item.builds.each() { build ->
  build.delete()
}
item.updateNextBuildNumber(1)
answered Oct 24, 2020 by MD
• 95,060 points

Related Questions In Jenkins

0 votes
2 answers

How to disable or reset security settings in Jenkins?

One other way would be to manually ...READ MORE

answered Aug 2, 2019 in Jenkins by Sirajul
• 58,990 points
4,462 views
0 votes
2 answers

how to execute a shell script post build step in Jenkins?

You could use the Post Build Task Plugin ...READ MORE

answered Jul 31, 2019 in Jenkins by Sirajul
• 58,990 points
18,215 views
0 votes
1 answer

How to fix a broken build for my project in jenkins?

The user needs to open the console ...READ MORE

answered Oct 11, 2019 in Jenkins by Sirajul
• 58,990 points
1,982 views
0 votes
1 answer

In Jenkins, actual build period time 30 mins. How to reduce the time 20 min??

If you are looking for allocating build ...READ MORE

answered Feb 11, 2020 in Jenkins by Sirajul
• 58,990 points
1,010 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
959 views
+2 votes
1 answer
+1 vote
3 answers

How to auto build a job in jenkins if there is any change in code on Github repository?

To automatically run build on code commit, follow ...READ MORE

answered Jul 31, 2019 in Jenkins by Sirajul
• 58,990 points
18,712 views
0 votes
1 answer

How to build specific tag in Jenkins?

Hi@akhtar, You may able to do that by using ...READ MORE

answered Dec 8, 2020 in Jenkins by MD
• 95,060 points
104 views