Skip to content

Instantly share code, notes, and snippets.

@sandroacoelho
Last active June 20, 2019 03:26
Show Gist options
  • Save sandroacoelho/e4417b8ed60848f6bc7d8c22624230bc to your computer and use it in GitHub Desktop.
Save sandroacoelho/e4417b8ed60848f6bc7d8c22624230bc to your computer and use it in GitHub Desktop.
Jenkins reset history
How to reset jobs in Jenkins
item = Jenkins.instance.getItemByFullName("your-job-name-here")
//THIS WILL REMOVE ALL BUILD HISTORY
item.builds.each() { build ->
build.delete()
}
item.updateNextBuildNumber(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment