Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete a view in Jenkins and automatically its jobs?

With Jenkins, if I delete a view, I want to delete the view's jobs also.

Is there a way to do it properly ?

like image 803
Youssouf Maiga Avatar asked Jul 25 '16 11:07

Youssouf Maiga


1 Answers

Before deleting your view: in "Manage Jenkins"->"Script Console", run this script:

Jenkins.instance.getView("MyView").items.each { item ->
    println "deleting $item.name"
    item.delete()
}

After that, the view will be empty -- delete it then.

like image 60
Alex O Avatar answered Oct 25 '22 00:10

Alex O