user_dev user_dev - 2 months ago 14
Groovy Question

How to add nested view in Jenkins using groovy?

I am trying to add a nested view using groovy script but is failing

Jenkins.instance.instance.addView(new hudson.plugins.nested__view.NestedView("Sample View"))


org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script1.groovy: 3: unable to resolve class hudson.plugins.nested__view.NestedView
@ line 3, column 35.
Jenkins.instance.instance.addView(new hudson.plugins.nested__view.NestedView("ViewX"

Answer

This worked for me in the Jenkins script console:

Jenkins.instance.addView(new hudson.plugins.nested_view.NestedView("Sample View"))
Comments