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 in Jenkins by akhtar
• 32,960 points
27 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 by MD
• 77,580 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,210 points
3,014 views
0 votes
2 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,210 points
13,079 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,210 points
16,587 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,210 points
1,520 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
803 views
+2 votes
1 answer
0 votes
1 answer

How to install jenkins in Redhat/CentOS?

Hi@akhtar, To install Jenkins in centOS/Redhat, you can ...READ MORE

answered Feb 6 in Jenkins by MD
• 77,580 points
218 views
0 votes
1 answer

How to merge two branch in GitHub using jenkins?

Hi@akhtar, To implement this task you can follow ...READ MORE

answered May 7 in Jenkins by MD
• 77,580 points
1,325 views