Skip to content

Instantly share code, notes, and snippets.

@chathudan
Created February 20, 2019 01:43
Show Gist options
  • Save chathudan/95144816d2e1e4f2b9bae6b56ca6321e to your computer and use it in GitHub Desktop.
Save chathudan/95144816d2e1e4f2b9bae6b56ca6321e to your computer and use it in GitHub Desktop.

Delete workspace builds

  1. Go to your Jenkins home page → Manage Jenkins → Script Console
  2. Run the following script there. Change JOB_NAME to your project name
def jobName = "JOB_NAME"
def job = Jenkins.instance.getItem(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