Does anyone know how to implement the SprintManager?

As seen in the method below, sprintManger.getAllSprints() is causing a null pointer exception . This makes me think that I am not implementing the SprintManager correclty.

// Here is the method where I am experiencing the problem

ServiceOutcome<Collection<Sprint>> getSprints(){

SprintManager sprintManager = ComponentAccessor.getComponent(SprintManagerImpl.class);

return sprintManager.getAllSprints();


I have also tried implementing the SprintManager by the following way:

SprintManager sprintManager = new SprintManagerImpl();

But it also causes a null pointer exception.

Does anyone know the right way to do this?


3 answers

1 accepted

Use REST calls to access sprint info. This is much easier then trying to use the SprintManager class.

Unfortunatly, it is a little more tricky to get this class. I managed it using this code:

private SprintManager getSprintManager() throws InvalidSyntaxException {
	ApplicationContext appCtx = (ApplicationContext) getGreenHopperAppCtx();
        if ( appCtx !=null ) {
	    	return (SprintManager) appCtx.getBean( "sprintManagerImpl" );
	    return null;
private Object getGreenHopperAppCtx() throws InvalidSyntaxException {
	OsgiContainerManager osgi = ComponentAccessor.getComponentOfType(OsgiContainerManager.class);
	    if ( osgi==null ) {
			 java.lang.System.out.println("OSGI Not Found");
			 return null;

	    Bundle[] bundles = osgi.getBundles();

	    for(int i=0;i&lt;bundles.length;i++) {
	    	Bundle bundle = bundles[i];

	        if ( "com.pyxis.greenhopper.jira".equals( bundle.getSymbolicName() ) ) {

	        	BundleContext bctx = bundle.getBundleContext();
	        	ServiceReference[] refs = bctx.getAllServiceReferences(null,null);
	        	if ( refs!=null ) {
	        		for(int j=0; j&lt;refs.length;j++) {
	        			Object prop = refs[j].getProperty("");
	        			if ( "com.pyxis.greenhopper.jira".equals(prop) ) {
	        				return bctx.getService( refs[j] );
	    return null;

Thanks, that is getting me closer to a solution. I am having an issue in the line

return(SprintManager) appCtx.getBean( "sprintManagerImpl");

My IDE seems to think that the ApplicationContext is an import from


Is that the import that you are using? My appCtx does not seem to have a method called getBean().

I currently can't tell you what class it was exactly, but I'm sure it was not from the electric.glue package. If I remember correctly, the class should be from org.springframework.

It's org.springframework.context ( To have it, you need to include in your pom.xml: <dependency> <groupId>org.springframework.osgi</groupId> <artifactId>spring-osgi-core</artifactId> <version>1.1.3</version> <scope>provided</scope> </dependency>

Aleksandr Zuevich Community Champion Sep 20, 2016

If my plugin is installed before greenhopper (Agile) is installed, I've got java.lang.ClassNotFoundException: com.atlassian.greenhopper.service.sprint.SprintManager. How to fix it?

I have the same error sad

I use it:

final PluginAccessor pluginAccessor = ComponentManager.getComponent(PluginAccessor.class);
Plugin plugin = pluginAccessor.getEnabledPlugin("com.pyxis.greenhopper.jira");

For Jira v7 look at

 (Took me a while to find it, and this thread came up a thousand times on google - has the right keywords in it. That's why I'm commenting on such an old entry.)

@Airpas_ICT Hi, this is using groovy though. Any idea on how to do this using pure java api?

The groovy is not far off, in fact it's using java calls already.

For the script that was quoted in the link, all you need to do is replace the "def" uses with the java variable object types for the return values (e.g. if you had "def i = 3", convert it to "int i = 3") and add ; to the end of the lines.

@Nic Brough [Adaptavist]

Is there a way to "extend" the built in 'Burndown Chart' that is provided with our current Jira instance?

If so how?

I have been searching through the source and I am unable to find it.

Please advise.



Not directly, but you could download the code and hack it (if you have a commercial licence)

@Nic Brough [Adaptavist]

Is there an example that shows the SprintManager usage for Jira 7?

Been searching for some time.

Suggest an answer

Log in or Join to answer
Community showcase
Alexey Matveev
Published Saturday in Jira

How to run Jira in a docker container

Everything below is tested on Ubuntu 17.10. I prefer to use Jira in a docker container because: 1. I can install Jira with a couple of commands. 2. I can start and stop Jira just by starting and s...

83 views 2 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot