Dashboard View : how to add unstable jobs portlet

16 views
Skip to first unread message

Pradeep Mascarenhas

unread,
Dec 28, 2016, 1:44:18 PM12/28/16
to job-dsl-plugin
Need to add unstable job to the dashboard portlet.


Portlet Xml :

<bottomPortlets>
<hudson.plugins.view.dashboard.core.UnstableJobsPortlet>
<id>dashboard_portlet_2000</id>
<name>Unstable Jobs</name>
<showOnlyFailedJobs>false</showOnlyFailedJobs>
<recurse>false</recurse>
</hudson.plugins.view.dashboard.core.UnstableJobsPortlet>
</bottomPortlets>

Daniel Spilker

unread,
Jan 7, 2017, 4:11:39 PM1/7/17
to job-dsl...@googlegroups.com
Hi!

You can use a configure block (https://github.com/jenkinsci/job-dsl-plugin/wiki/The-Configure-Block) to add the XML:

dashboardView('example') {
    configure {
        it / bottomPortlets << 'hudson.plugins.view.dashboard.core.UnstableJobsPortlet' {
            id('dashboard_portlet_2000')
            name('Unstable Jobs')
            showOnlyFailedJobs(false)
            recurse(false)
        }
    }
}


I'll try to enable the Automatically Generated DSL (https://github.com/jenkinsci/job-dsl-plugin/wiki/Automatically-Generated-DSL) for the portlets, so that the DSL will support all portlets.

Regards,
Daniel

--
You received this message because you are subscribed to the Google Groups "job-dsl-plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugin+unsubscribe@googlegroups.com.
To post to this group, send email to job-dsl-plugin@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/8303d4ab-c05a-43cb-8adb-7a9a73cf1b02%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Spilker

unread,
Jan 7, 2017, 5:47:40 PM1/7/17
to job-dsl...@googlegroups.com
With the next release (1.57) you can also use this syntax:

dashboardView('db-example') {
  bottomPortlets {
    unstableJobsPortlet {

      name('Unstable Jobs')
      showOnlyFailedJobs(false)
      recurse(false)
    }
  }
}

To post to this group, send email to job-dsl...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages