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 25, 2020 in Jenkins by akhtar
• 38,230 points
4,856 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 25, 2020 by MD
• 95,440 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
• 59,230 points
20,196 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
• 59,230 points
28,544 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
• 59,230 points
8,001 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
• 59,230 points
3,478 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 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
3,503 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
• 59,230 points
76,101 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,440 points
3,766 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP