How to get a Dashboard programmatically?

JIRA Plugin Developer June 30, 2014

Hello everybody,

how do I get a Dashboard by JavaCode. The Dashboard has already been created in JIRA and I want to access this dashboard. Is there any possibilities to get the dashboard by id or name.

An answer would help me to go on with the development of my JIRA Plugin.

2 answers

1 accepted

1 vote
Answer accepted
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 30, 2014
JIRA Plugin Developer June 30, 2014

Thx for the advice. I've already seen this Service. Can you give a Code Sample, please?

Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 1, 2014
ComponentAccessor.getComponent(PortalPageService.class).getPortalPage(new JiraServiceContextImpl(user), dashboardId)

Try this.

JIRA Plugin Developer July 1, 2014

how do I get/find the dashboard id?

I know it doesn't belong to the question above, but are there any event listener for dashboards? For example when you update an dashboard, an event will be triggered in the background.

0 votes
JIRA Plugin Developer July 1, 2014

OK, the dashboard Id can be found in the URL as an URL parameter leading to your dashboard. This URL parameter is the selectPageId corresponding to your dashboard id.

E.g.: http://host/jira/secure/Dashboard.jspa?selectPageId=10201

Is there a possibility now to get all the gadgets with the portalpage-instance or do I need another approach?

It would be very helpful again if you show me a sample code.

Suggest an answer

Log in or Sign up to answer