Tuesday, June 04, 2013

How to delete multiple jobs in Jenkins

over time, a Jenkins server can amass a large of jobs (or projects as the "Delete" link calls them) and having to delete them one by one can be laborious to perform through the UI.

Fortunately, Jenkins includes a scripting engine that can be run through the UI that handles the task very well.

Open the following URL: http:///script
and enter the following code in the textbox:

for(job in jenkins.model.Jenkins.theInstance.getProjects()) {
    job.delete();
}

and moments later, all the jobs are removed!

No comments: