來源:https://www.jianshu.com/p/e342b52d45e1ui
執行命令:item = Jenkins.instance.getItemByFullName("your-job-name-here") //THIS WILL REMOVE ALL BUILD HISTORY item.builds.each() { build -> build.delete() } item.updateNextBuildNumber(1)