Skip to content

Instantly share code, notes, and snippets.

@k0staa
Last active October 13, 2017 12:28
Show Gist options
  • Select an option

  • Save k0staa/17076744031c1a52a22759fc9aa25cce to your computer and use it in GitHub Desktop.

Select an option

Save k0staa/17076744031c1a52a22759fc9aa25cce to your computer and use it in GitHub Desktop.
Deletes job history and set job build number to 1
def jobName = "APP-RELEASE"
def job = Jenkins.instance.getItem(jobName)
job.getBuilds().each { it.delete() }
// uncomment these lines to reset the build number to 1:
job.nextBuildNumber = 1
job.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment