Skip to content

Instantly share code, notes, and snippets.

@gargolito
Created February 22, 2019 03:40
Show Gist options
  • Save gargolito/9cbcc97121d4832bb9f1752968677776 to your computer and use it in GitHub Desktop.
Save gargolito/9cbcc97121d4832bb9f1752968677776 to your computer and use it in GitHub Desktop.
#misc
GOTO https://your.jenkins.url/script
copy paste the below, update name of the project
click run, there will be no output. the project builds will be reset back to zero
item = Jenkins.instance.getItemByFullName("PROJECTNAME")
//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