Created
October 23, 2018 09:37
-
-
Save samuelstein/d5f73d967dd32241dde3dfda77e9ef10 to your computer and use it in GitHub Desktop.
Clear jenkins view with jobs
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
import hudson.model.ListView | |
import jenkins.model.* | |
//Parameters: In case you are running this outside Scriptler, please uncomment and fill the following line. | |
view_name = "ViewName"; | |
vc = Jenkins.instance.getView(view_name).getOwner(); | |
v = vc.getView(view_name); | |
//delete jobs belonging to the view | |
for(view in v.getItems()) { | |
print "removing $view \n" | |
view.delete(); | |
} | |
//vc.deleteView(v); | |
print "$view_name removed \n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment