So if you want to delete all previous Jenkins build, let's follow these steps:
1. Go to Jenkins home page
2. Manage Jenkins
3. Click script console
4. A text box will open enter below script after replacing your project name with project_name
def jobName = "project_name"
def job = Jenkins.instance.getItem(jobName)
job.getBuilds().each { it.delete() }
job.nextBuildNumber = 1
job.save()
0 Comments