Skip to content

Instantly share code, notes, and snippets.

@bernardoVale
Last active July 12, 2018 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bernardoVale/fa0050aac7e0a8c7dd6ffdb6dad2b42c to your computer and use it in GitHub Desktop.
Save bernardoVale/fa0050aac7e0a8c7dd6ffdb6dad2b42c to your computer and use it in GitHub Desktop.
Delete all Builds && Restore to Build 1
def jobName = "folder/job/branch"
def job = Jenkins.instance.getItemByFullName(jobName)
job.getBuilds().each { it.delete() }
job.nextBuildNumber = 1
job.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment