How to use the Groovy Script Runner to list Agile Projects

Malesys Elie January 28, 2014

Hello,

I need to list all projects using Agile plugin ( the final goal is to list Agile users)

I guess the method GHConfiguration.getGrantedProjects (from com.pyxis.greenhopper.jira.configurations) provides this list but I can't find a way to get the instance of GHConfiguration.

any help will be welcome :)

(environment : JIRA 5.1.8 / Agile 6.3.1)

thanks in advance.

Regards

Elie

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
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.
January 28, 2014

This should work... but it's not a stable API so may break at some point:

(Hack mode on)

import com.atlassian.jira.component.ComponentAccessor

def ghPlugin = ComponentAccessor.getPluginAccessor().getEnabledPlugin("com.pyxis.greenhopper.jira")
def descriptor = ghPlugin.getModuleDescriptor("greenhopper-launcher")
def applicationContext = descriptor.getModule().greenHopperCacheManager.applicationContext
def bridgeServiceLocator = applicationContext.getBean("bridgeServiceLocator")
def greenhopper = bridgeServiceLocator.getInstance().getGreenHopper()

greenhopper.getGHConfiguration().getGrantedProjects() // returns list of pids

Malesys Elie January 29, 2014

it's works fine, thanks alot for this quick and plain answer Jamie :)

Malesys Elie January 30, 2014

if someone has the same need as me (list project roles actors for each Agile project), the final script is available on Github:

https://gist.github.com/ElieMalesys/8711402<br< a="">>

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.
January 30, 2014

+1... but maybe next time try a MarkupBuilder ;-)

nupur sarkar March 30, 2015

hey hi Jamie... can you please help me out with the java api to do the same ??

mike brosnan June 10, 2016

These gist's are not available any more, I wanted to find a way to get the number of swimlanes+colours configured in kanban boards and these can cause slowness in boards and can cause so much load that the system is brought down

TAGS
AUG Leaders

Atlassian Community Events