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!

95 comments:

  1. Replies
    1. IEEE Final Year Project centers make amazing deep learning final year projects ideas for final year students Final Year Projects for CSE to training and develop their deep learning experience and talents.

      IEEE Final Year projects Project Centers in India are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation.

      corporate training in chennai corporate training in chennai

      corporate training companies in india corporate training companies in india

      corporate training companies in chennai corporate training companies in chennai

      I have read your blog its very attractive and impressive. I like it your blog. Digital Marketing Company in Chennai

      Delete
  2. Awesome...worked like a charm!

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

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

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

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

    ReplyDelete
  7. 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
  8. Thank you for the nice article here. Really nice and keep update to explore more gaming tips and ideas.

    Focus Group Testing

    PC Game Testing

    Mobile Game Testing

    Console Game Testing

    ReplyDelete

  9. Soma pill is very effective as a painkiller that helps us to get effective relief from pain. This cannot cure pain. Yet when it is taken with proper rest, it can offer you effective relief from pain.
    This painkiller can offer you relief from any kind of pain. But Soma 350 mg is best in treating acute pain. Acute pain is a type of short-term pain which is sharp in nature. Buy Soma 350 mg online to get relief from your acute pain.

    https://globalonlinepills.com/product/soma-350-mg/


    Buy Soma 350 mg
    Soma Pill
    Buy Soma 350 mg online



    Buy Soma 350 mg online
    Soma Pill
    Buy Soma 350 mg

    ReplyDelete
  10. Nice and excellent post. Very well explained. Thanks for the information....
    DevOps Training
    DevOps Online Training

    ReplyDelete
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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
  16. I am regular reader of your blog from long time,What a Beautiful post! This is so chock full of useful information I can’t wait to dig and start using my time on blogging,.
    DevOps Training in Chennai | DevOps Training in anna nagar | DevOps Training in omr | DevOps Training in porur | DevOps Training in tambaram | DevOps Training in velachery

    ReplyDelete
  17. 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
  18. 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
  19. 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
  20. 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
  21. 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
  22. 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
  23. 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
  24. 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
  25. 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
  26. 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
  27. 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
  28. Did you know that you can easily view the contents of your phone on your TV without a cable? With a screen mirror app you can easily do the screen mirroring from Android to TV. Check out www.screenmirroring.me to find out more.

    ReplyDelete
  29. تعتبر شركة الدرع المثالي من افضل شركات الخدمات فى المملكة العربية السعودية حيث تقدم الشركة العديد من الخدمات مثل كونها افضل شركة تنظيف بالرياض خدمة التنظيف تعتبر من افضل خدمات التى يحتاجها المواطن السعودي فى الفترة الحالية بسبب انتشار فيروس كورونا لذلك الشركة تقدم خدمة التنظيف فى مناطق متعددة مثل شركة تنظيف بالقصيم وايضا تقدم خدمة التنظيف فى شركة تنظيف بالدمام بالاضافة الى شركة تنظيف بجدة خدمة التنظيف تاتي مع التعقيم ولكن فى الفترة الاخير بدءت شركة الدرع المثالي فى تقديم خدمات تعقيم وبالاخص ضد فيروس كورونا فى مناطق متعددة مثل شركة تعقيم بالرياض وايضا شركة تعقيم بالقصيم وفى كلا من شركة تعقيم بالدمام و شركة تعقيم بجدة ومن الخدمات الذهبية التى تقدمها الشركة هي خدمة غسيل سيارات متنقل تعتبر من اكثر الخدمات التى يحتاجها كل مواطن لكثرة استخدام السيارات الخاصة فى التنقل وعدم استخدام المواصلات العامة .

    ReplyDelete

  30. 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
  31. 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
  32. 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
  33. 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
  34. 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
  35. شركة تنظيف منازل بالرياض بأفضل المنظفات والمطهرات وارخص الاسعار مقابل شركات التنظيف الأخرى خصم على جميع خدمات شركة تنظيف منازل بالرياض خدمات الشركة
    شركة تنظيف شقق بالرياض
    شركة تنظيف خزانات بالرياض
    شركة تنظيف كنب بالرياض
    شركة تنظيف منازل بالرياض
    شركة تنظيف بالرياض
    شركة تنظيف منازل بالرياض
    شركة تنظيف سجاد بالرياض

    ReplyDelete
  36. 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
  37. 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
  38. 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
  39. 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
  40. 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
  41. 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
  42. شركة رواد الحرمين الموقع الرائد فى عالم الخدمات المنزليه والاول بالمملكه العربيه السعوديه
    لما يتمتع به من خدمات مميزه ، فالبرغم من اننا مؤسسه ربحيه الا ان
    مزاولة نشاطتنا كلها مرتبط على نحو وثيق بتلبية


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


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


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

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

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

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

    ReplyDelete