`def jobName = "XT" # 项目名称

def maxNumber = 15330 # 删除该编号以下所有构建历史

Jenkins.instance.getItemByFullName(jobName).builds.findAll {

it.number <= maxNumber

}.each {

it.delete()

}
Jenkins.instance.getItemByFullName(jobName).updateNextBuildNumber(1) # 重置下次构建编号为 1`