Last active
July 12, 2018 19:51
-
-
Save bernardoVale/fa0050aac7e0a8c7dd6ffdb6dad2b42c to your computer and use it in GitHub Desktop.
Delete all Builds && Restore to Build 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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