user_dev user_dev - 1 year ago 201
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 Source

This worked for me in the Jenkins script console:

Jenkins.instance.addView(new hudson.plugins.nested_view.NestedView("Sample View"))
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download