Skip to content

Instantly share code, notes, and snippets.

@jghankins
Created August 5, 2019 01:17
Show Gist options
  • Select an option

  • Save jghankins/f21566f1c908e37fac5abaaa44feb20b to your computer and use it in GitHub Desktop.

Select an option

Save jghankins/f21566f1c908e37fac5abaaa44feb20b to your computer and use it in GitHub Desktop.
Delete Jenkins Jobs
def jobName = "copy_folder"
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