Step-by-step guide

  1. goto 

    [jenkins-instance]/script
  2. insert this script and update the job name

    item = Jenkins.instance.getItemByFullName("your-job-name-here")
    //THIS WILL REMOVE ALL BUILD HISTORY
    item.builds.each() { build ->
      build.delete()
    }
    item.updateNextBuildNumber(1)

To delete all build of all jobs use:

for (item in Jenkins.instance.items) {
  item.builds.each() { build ->
    build.delete()
  }
  item.updateNextBuildNumber(1)
}

Related articles

Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.

Related issues