How to delete Views under Jenkins without affecting existing jobs

前端 未结 2 979
别跟我提以往
别跟我提以往 2021-02-15 23:56

I want to delete Views under Jenkins without affecting the Jobs under the view. I am asking this since I am not able to enter same name of View even after deleting this as an Ad

2条回答
  •  南方客
    南方客 (楼主)
    2021-02-16 00:14

    For deleting a view (and not touching any jobs therein) use

    def view = Jenkins.instance.getView("MyView")
    Jenkins.instance.deleteView( view )
    

    Your code deletes the jobs in the view (but not the view itself), so be careful with that : )

提交回复
热议问题