Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,332,703
Community Members
 
Community Events
169
Community Groups

How to use the Groovy Script Runner to list Agile Projects

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

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

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

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="">>

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

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

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

Atlassian Community Events