Wednesday, May 04, 2016

How to clean and reset Jenkins build history

When you working with Jenkins while building your solution, definitely you have to run your project multiple times. It will result to a long Build History list that looks ugly and unnecessary for your production environment.

 If you need to clean this Build History, and reset the build number, you can run a simple script in  Jenkins Script Console. Here are the steps to do so.

1. Go to `Jenkins Script Console`
Go to your Jenkins home page > Manage Jenkins > Script Console


2. Run the script to clean and reset

Copy and paste this script to your Console Script text area and change the "copy_folder" to project name that you need to clean the history. Then click the "Run button".


def jobName = "copy_folder"
def job = Jenkins.instance.getItem(jobName)
job.getBuilds().each { it.delete() }
job.nextBuildNumber = 1
job.save()

Now check your Build History for the particular project, Wow!, it's clean now!

84 comments:

  1. Awesome...worked like a charm!

    ReplyDelete
  2. Script deletes build history for me. But build # reset to 1 not working. Could you please help?

    ReplyDelete
  3. Doesn't work for multibranch pipeline projects. Any advise?

    ReplyDelete
  4. Very Nice it works
    THX !!! ;)

    ReplyDelete
  5. The build starts from previous build number even if its cleared any help on this ? The change is momentary

    ReplyDelete
  6. Nice blog..! I really loved reading through this article. Thanks for sharing such a amazing post with us and keep blogging... best angularjs training institute in chennai | angularjs training in omr | angular 4 training in chennai | angularjs training in chennai

    ReplyDelete
  7. Thank you for the nice article here. Really nice and keep update to explore more gaming tips and ideas...
    AngularJS Training in Bangalore | AngularJS Course Fees | AngularJS 6 - i Digital Academy - AngularJS Training in Bangalore - Learn AngularJS 6 from Expert Real-time Trainers
    at i Digital Academy with Live Projects and Placement Assistance. Book a Free Demo Today.

    ReplyDelete
  8. I think this is one of the most important info for me.And i am glad reading your article. But want to remark on few general things, The site style is good , the articles is really excellent and also check Our Profile for devops training in chennai, devops training videos

    ReplyDelete
  9. Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
    angularjs online training

    ReplyDelete
  10. I just loved your article on the beginners guide to starting a blog.If somebody take this blog article seriously in their life, he/she can earn his living by doing blogging.thank you for thizs article. top devops online training

    ReplyDelete
  11. Nice to be seeing your site once again, it's been weeks for me. This article which ive been waited for so long. I need this guide to complete my mission inside the school, and it's same issue together along with your essay.

    python training in bangalore

    python training in hyderabad

    python online training

    python training

    python flask training

    python flask online training

    python training in coimbatore


    ReplyDelete
  12. A very nice guide. I will definitely follow these tips. Thank you for sharing such detailed article. I am learning a lot from you.
    Java Training in Chennai

    Java Training in Bangalore

    Java Training in Hyderabad

    Java Training
    Java Training in Coimbatore


    ReplyDelete
  13. CrownQQ Agen DominoQQ BandarQ dan Domino99 Online Terbesar

    Yuk Buruan ikutan bermain di website CrownQQ
    Sekarang CROWNQQ Memiliki Game terbaru Dan Ternama loh...

    9 permainan :
    => Poker
    => Bandar Poker
    => Domino99
    => BandarQ
    => AduQ
    => Sakong
    => Capsa Susun
    => Bandar 66
    => Perang Baccarat (NEW GAME)

    => Bonus Refferal 20%
    => Bonus Turn Over 0,5%
    => Minimal Depo 20.000
    => Minimal WD 20.000
    => 100% Member Asli
    => Pelayanan DP & WD 24 jam
    => Livechat Kami 24 Jam Online
    => Bisa Dimainkan Di Hp Android
    => Di Layani Dengan 5 Bank Terbaik
    => 1 User ID 9 Permainan Menarik
    => Menyediakan deposit Via Pulsa Telkomsel & XL

    Link Resmi CrownQQ:
    - crownqq01.com
    - crownqq01.net
    - crownqq01.org

    Info Lebih lanjut Kunjungi :
    Website : CrownQQ
    Daftar CrownQQ : Poker Online
    Info CrownQQ : Kontakk
    Linktree : Agen Poker Online

    WHATSAPP : +855882357563
    Line : CS CROWNQQ
    Facebook : CrownQQ Official
    Kemenangan CrownQQ : Agen BandarQ

    ReplyDelete
  14. Very interesting blog. Many blogs I see these days do not really provide anything that attracts others, but believe me the way you interact is literally awesome.You can also check my articles as well.

    Security Guard License
    Ontario Security License
    Security License Ontario
    Security License

    Thank you..

    ReplyDelete
  15. Yuk Gabung di NAGAQQ: AGEN BANDARQ BANDARQ ONLINE ADUQ ONLINE DOMINOQQ TERBAIK

    Yang Merupakan Agen Bandarq, Domino 99, Dan Bandar Poker Online Terpercaya di asia hadir untuk anda semua dengan permainan permainan menarik dan bonus menarik untuk anda semua

    Bonus yang diberikan NagaQQ :
    * Bonus rollingan 0.5%,setiap senin di bagikannya
    * Bonus Refferal 10% + 10%,seumur hidup
    * Bonus Jackpot, yang dapat anda dapatkan dengan mudah
    * Minimal Depo 15.000
    * Minimal WD 20.000

    Games Yang di Hadirkan NagaQQ :
    * Poker Online
    * BandarQ
    * Domino99
    * Bandar Poker
    * Bandar66
    * Sakong
    * Capsa Susun
    * AduQ
    * Perang Bacarrat (New Game)

    Tersedia Deposit Via pulsa :
    Telkomsel & XL

    Info Lebih lanjut Kunjungi :
    Website : NagaQQ
    Facebook : NagaQQ Official
    Kontakk : Info NagaQQ
    linktree : Agen Judi Online
    WHATSAPP 1 : +855977509035
    Line : Cs_nagaQQ
    TELEGRAM : +855967014811


    BACA JUGA BLOGSPORT KAMI YANG LAIN:
    agen bandarq terbaik
    Winner NagaQQ
    Daftar NagaQQ
    Agen Poker Online

    ReplyDelete
  16. Nice & Informative Blog !
    If you are looking for the best accounting software that can help you manage your business operations. call us at QuickBooks Customer Service Number 1-855-974-6537.

    ReplyDelete
  17. Thanks for sharing such useful information with us. I hope you will share some more info about your blog. Please Keep sharing. We will also provide Quickbooks Customer Service Phone Number Contact us +18777510742 for instant help.

    ReplyDelete
  18. This is excellent information. It is amazing and wonderful to visit your site. Thanks for sharing this information, this is useful to me...

    Looking for the best PPC course in Bangalore India? Learn PPC from Ranjan Jena, 10+ Years Expert Google Ads Trainer. 1000+ Students Trained @ eMarket Education, Koramangala, Bangalore.
    Best Online Digital Marketing Courses in Bangalore, India
    Best Digital Marketing Institute in Bangalore

    ReplyDelete
  19. Very interesting article to read it. I would like to thank you for the efforts you had made for writing this wonderful article. This article inspired me to read more. Keep sharing on updated posts…

    Learn Digital Marketing Course in Bangalore with Live Project Work & Case Studies taught by Ranjan Jena (10Yrs Trainer). 100% Guarantee to Clear Job Interview. You can also check my article..

    SEO Course
    PPC Google Adwords Course
    Social Media Course
    Google Analytics Course
    Adobe Analytics Course
    Graphic Designing Course

    ReplyDelete
  20. Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
    devops online training
    best devops online training
    top devops online training

    ReplyDelete

  21. Dr. Vivek Galani is a leading expert in skin and hair. At hair transplant clinic in Surat Skin Care, Cosmetic Laser, Hair Transplant & Slimming Center, Dr. Galani offers the most advanced cosmetic and dermatologic care treatments. The clinic uses advanced FUE methods to produce high-quality hair transplants.

    ReplyDelete
  22. Nice post!

    Worried About QuickBooks Error ?Get in touch with QuickBooks expert for instant solution.
    Click Here to know how to fix QuickBooks Error 12152

    Dial on QuickBooks Error Support Number +1-855-977-7463.

    ReplyDelete
  23. Nice Blog !
    At times, while filing form 941, you may face QuickBooks Form 941 Error when the total sum of the tax amount exceeds $2500. To fix such issue, you must contact our experts via QuickBooks Support Number and get permanent ways to solve QuickBooks problems.

    ReplyDelete
  24. Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
    devops online training
    best devops online training
    top devops online training

    ReplyDelete
  25. Shreeja Health Care is leading manufacturer of Mini oil Maker Machine. Shreeja Oil Extraction Machine is able to extract oil from various seeds like peanuts, Coconut, Sesame, Soybean, macadamia nuts, walnuts, sunflower seeds, vegetable seeds flaxseed et

    ReplyDelete
  26. شركة تنظيف منازل بالرياض بأفضل المنظفات والمطهرات وارخص الاسعار مقابل شركات التنظيف الأخرى خصم على جميع خدمات شركة تنظيف منازل بالرياض خدمات الشركة
    شركة تنظيف شقق بالرياض
    شركة تنظيف خزانات بالرياض
    شركة تنظيف كنب بالرياض
    شركة تنظيف منازل بالرياض
    شركة تنظيف بالرياض
    شركة تنظيف منازل بالرياض
    شركة تنظيف سجاد بالرياض

    ReplyDelete
  27. Your blog is very nice and has sets of the fantastic piece of information. Thanks for sharing with us. If you face any technical issue or error, visit:

    Quickbooks customer service

    ReplyDelete
  28. Thanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support in this area. same as your blog i found another one Mobile Marketing .Actually I was looking for the same information on internet for Mobile Marketing and came across your blog. I am impressed by the information that you have on this blog. Thanks once more for all the details.

    ReplyDelete
  29. Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
    angular js online training
    best angular js online training
    top angular js online training

    ReplyDelete
  30. Shreeja Health Care is leading manufacturer of Oil Maker Machine. Shreeja Oil Extraction Machine is able to extract oil from various seeds like peanuts, Coconut, Sesame, Soybean, macadamia nuts, walnuts, sunflower seeds, vegetable seeds flaxseed etc.

    ReplyDelete
  31. Thanks for sharing such useful information with us. I hope you will share some more info about your blog. Please keep sharing. We will also provide QuickBooks Customer Service Number for instant help.

    ReplyDelete
  32. شركة رواد الحرمين الموقع الرائد فى عالم الخدمات المنزليه والاول بالمملكه العربيه السعوديه
    لما يتمتع به من خدمات مميزه ، فالبرغم من اننا مؤسسه ربحيه الا ان
    مزاولة نشاطتنا كلها مرتبط على نحو وثيق بتلبية


    شركه عزل فوم بالرياض


    تركيب حجر فرعني


    شركه عزل فوم بالدمام

    شركه عزل فوم بالقطيف

    شركه عزل فوم بالاحساء

    شركه عزل فوم بالجبيل

    ReplyDelete
  33. تقدم شركة الدرع المثالي الكثير من التخفيضات على خدماتها المتميزة مثل تصليح مكيفات في دبي  و  تصليح بوتاجازات في دبي بالاضافة ايضا الى خدمات الشركة فى امارة اصلاح مكيفات في عجمان  و خدمات اخرى وكثيرة مثل صيانة مكيفات في دبي ويمكنك الحصول على خدمات شركة الدرع المثالي فى امارة الشارقة من خلال زيارة الرابط التالي للخدمة تصليح افران في الشارقة

    ReplyDelete
  34. I would like to take this opportunity to thank the author for his incredible work. I believe Customer relationship management is essential for every business to create a loyal customer base. keep doing it. all the best
    Top CRM Software

    ReplyDelete
  35. Are you looking for the best Azure training in Chennai? Here is the best suggestion for you, Infycle Technologies the best Software training institute in Chennai to study Azure platform with the top demanding courses such as Graphic Design and Animation, Cyber Security, Blockchain, Data Science, Oracle, AWS DevOps, Python, Big data, Python, Selenium Testing, Medical Coding, etc., with best offers. To know more about the offers, approach us on +91-7504633633, +91-7502633633

    ReplyDelete
  36. This comment has been removed by the author.

    ReplyDelete
  37. We SVJ Technocoat are the leading Service Provider and Exporter of an extensive array of PVD Coating Services In Surat Service and Vapor Deposition Coating Service etc. We are a well known firm for providing excellent quality coating services across the nation and in a timely manner. Owing to our improvised business models, our professionals are offering integrated solutions for our clients.

    ReplyDelete
  38. DIYAM Impex Our Company DIYAM IMPEX. We have gone from strength to strength over the years, having expanded from our core business of diamond manufacturing to Real Estate, Renewable Energy and Venture Capital. Diamond has its many utility and its industrial value is enhanced by our effective services. We now focus exclusively on CVD Diamonds Manufacturer. DIYAM IMPEX has grown to become a globally trusted and respected player in the diamond industry over the last five decades. Our expertise lies in our ability to produce a consistent supply of quality polished diamonds in all shapes and sizes.

    ReplyDelete
  39. Candela GentleLASE medical grade laser applies precise, controlled pulses of laser. Laser Hair Removal Treatment in Auckland energy that reach down the hair shaft into the follicle underneath the skin, cauterizing the hair at its root. the encompassing tissue or skin isn’t damaged. The laser’s gentle beam of sunshine damages and consequently prevents the follicle from growing.

    ReplyDelete
  40. Shreeja Oil Maker is a global leading manufacturer, wholesaler, supplier, exporter of various small scale machinery. Shreeja oil maker machine or Mini Oil Maker Machine is one of our innovative product which is able to extract 100% pure oil from the various seed. This is also known as a cold oil press machine or mini oil Ghani. We have a stronghold in national as well as a worldwide market.

    ReplyDelete
  41. How To Clean And Reset Jenkins Build History ~ Code Ketchup >>>>> Download Now

    >>>>> Download Full

    How To Clean And Reset Jenkins Build History ~ Code Ketchup >>>>> Download LINK

    >>>>> Download Now

    How To Clean And Reset Jenkins Build History ~ Code Ketchup >>>>> Download Full

    >>>>> Download LINK

    ReplyDelete
  42. How To Clean And Reset Jenkins Build History ~ Code Ketchup >>>>> Download Now

    >>>>> Download Full

    How To Clean And Reset Jenkins Build History ~ Code Ketchup >>>>> Download LINK

    >>>>> Download Now

    How To Clean And Reset Jenkins Build History ~ Code Ketchup >>>>> Download Full

    >>>>> Download LINK 3h

    ReplyDelete
  43. thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website devops Online Training
    best devops Online Training
    top devops Online Training

    ReplyDelete
  44. Your website is very beautiful or Articles. I love it thank you for sharing for everyone. Africa hemp CBD

    ReplyDelete
  45. Thanks for Sharing This Article. It is very so much valuable content.

    ReplyDelete
  46. wordpress website design agency in united states Need professional WordPress Web Design Services? We're experts in developing attractive mobile-friendly WordPress websites for businesses. Contact us today!

    ReplyDelete
  47. Great share! Thanks for the information. Keep going!

    ReplyDelete
  48. Great share! Thanks for the informatiom. Keep going!

    ReplyDelete