Creating a dashboard when a project is created

JR S July 28, 2011

Hello there =)

I would like to automatically create a dashboard when a project is created, the dashboard layout and gadgets would be the same for all of these dashboards, but they would display the informations for the project they have been created for. The project leader would be the creator of the dashboard, in order to be able to modify it.

I thought it may be possible to do this using triggers in PostreSQL, anyone can confirm ?

Is there a way to do it via JIRA ?

Thanks for any advice =)

3 answers

1 accepted

1 vote
Answer accepted
Betsy Walker
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 31, 2011

There's a canned script in the Script Runner plugin that changes the ownership of a dashboard but you'd need to pull together your own Groovy script to copy a 'template' dashboard you've created.

You could probably stitch something together using Jamie's script here to push out a dashboard + the createBasedOnClone( ) method in the PortalPageManager API.

JamieA
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 31, 2011

Yes that would be a good start. I'd define a "template" dashboard, clone it, iterate through the gadgets and modify the filterOrProjectId parameter for each one to point to the newly created project.

JR S August 1, 2011

Buuhuu ;(
I just can't find out how to install this plugin...
I shutdown jira, copy the jar into the lib, restart jita, enable the plugin, and when I try to access the buttons to enter the script I get a 404 error ;(

HTTP Status 404 - Could not execute action [GroovyRunner]:groovy/lang/GroovyClassLoader

Also , the button label is shown as: item.groovy.runner.label , not the actual label , any clue ? =(

JamieA
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.
August 1, 2011

You need to add two jars, both in web-inf/lib. If you're stuck create a ticket in https://studio.plugins.atlassian.com/browse/GRV - a.a.c is not a good forum for this.

But note that it's not going to do magic for you - if you want to do this yourself you'll need a reasonable knowledge of the jira api and programming skills.

JR S August 1, 2011

I think I got enough programming skills, but at the moment i have nowhere to type my code in.

Though it's true that I got no experience of the jira api.

But I need to do it anyway... sorry if I take your time =(

You say I must add two jars, but i got only 1 from the plugin, wich is the other one ?

Groovy works perfectly fine using groovyConsole...

0 votes
Betsy Walker
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.
August 1, 2011

As the installation instructions say, download 'groovy-runner.N.jar' and also a Groovy distro as well (from here), place both in WEB-INF/lib and restart JIRA.

Good luck!

JR S August 1, 2011

I've done , it works perfectly, now I can do what I do best =)

Thanks for helping !

0 votes
J Thomas
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 28, 2011

Nice thought, wish it were possible! There are so many database tables this would affect though that it's not practical to manage this directly in the database (plus you'd need a restart to pick up the changes) and I don't know of any way to do this in JIRA itself, so join the copy-dashboard-copy/edit-filters-update-gadgets club and remember that banging your head against a wall supposedly burns 150 calories an hour (which might be slightly more entertaining)!

(Unless there's a Script Runner script for this out there somewhere, well I can dream...)

JR S July 31, 2011

We won't need to restart if the database is not embedded right ?

Ah well, since u have to do it for my work placement i'll just do it in javascript

, are you interested in the result ?

J Thomas
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 31, 2011

I'd love to know if you manage to get something working!

WRT needing a restart, JIRA caches lots of database information when it starts up so changes made directly in the database are often not reflected in JIRA until it is restarted and caches the new data.

Suggest an answer

Log in or Sign up to answer