jenkins clear all build log code example
Example: jenkins clear all build log
Jenkins.instance.getAllItems(Job.class).each{ jobitem->
def job = Jenkins.instance.getItem(jobitem.name)
job.getBuilds().each { bh -> bh.delete() }
job.nextBuildNumber = 1
job.save()
}