Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-66342

Dashboard View views can't be created via groovy scripts

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • dashboard-view-plugin
    • None
    • Jenkins 2.289.3, Dashboard-view 2.17

      I am unable to use groovy scripts to create a view with Dashboard View.  Any reference to a property of a dashboard that isn't already a property of a view (like useCssStyle or leftPortlets) results in an error. For example, I would expect this groovy code to create a view in the folder (other plain listView blocks work in this folder):

      folder(projectFolderName) {
      	description(projectFolderName + ' Regression Jobs')
      	views{
      		dashboardView('Tests Dashboard') {
      			description('Test result dashboard for ' + projectFolderName)
      			recurse(true)
      			jobs {
      				regex('[\\w\\s]+\\/.*')
      			}
      			columns testDashboardColumns
      			useCssStyle(true)
      			leftPortletWidth('66%')
      			rightPortletWidth('33%')
      			leftPortlets() {
      				hudsonStdJobsPortlet('Latest Test Results')
      			}
      			rightPortlets {
      				unstableJobsPortlet
      				{
      					name('Tests with Failures')
      					showOnlyFailedJobs(true)
      					recurse(true)
      				}
      			}
      		}
      	}
      }
      

      Instead, it results in this error:

      Processing DSL script myJobs.groovy
      ERROR: (myJobs.groovy, line 789) No signature of method: javaposse.jobdsl.dsl.views.DashboardView.useCssStyle() is applicable for argument types: (java.lang.Boolean) values: [true]
      Finished: FAILURE
      

      In the above example, if I omit useCssStyle, I just get similar errors on the next dashboard property. I have tried different arguments and styles of setting any of the properties to no avail.

      Is this user error? Am I improperly trying to set up this view? Or is there something in Dashboard View that isn't configured in a way that will allow me to set them up this way?

            tgr Tobias Gruetzmacher
            amellis Adam Ellis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: