How to get all sprints in project using JIRA REST API

lokesh cherukuri June 14, 2016

Is there anything something like "http://www.example.com/jira/rest/agile/1.0/sprint?project=XYZ", to retrieve all the sprints in a project.

JIRA platform api can retrieve projects info and JIRA software API can retrieve sprints for a given board. But i need sprints for any given project (combination) or atleast boards for a given project so that i can retrieve sprints in those boards later

6 answers

1 accepted

8 votes
Answer accepted
Matthias Gaiser _K15t_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 27, 2016

Just in case you are still looking (or someone else is looking like me), you can get all the boards valid for a project with the same request to get all boards (see https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board-getAllBoards).

You just have to specify as query argument (projectKeyOrId) your project. Afterwards you can use https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board/{boardId}/sprint-getAllSprints to get all the sprints for a board.

Vijay Anand July 21, 2017

This will include sprints not only for the project in question but all projects that are part of the board isn't it?

Matthias Gaiser _K15t_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 9, 2017

As far as I understand, the sprints belong to the board and not the project. The mentioned method will list the sprints of the current board.

And these sprints can be used in multiple projects.

2 votes
senduran June 12, 2020

I used something like this and receive all the sprints for a project.

but you cannot find the greenhoppers documentation now. it has been deprecated. but the UrL i mentioned below is still working.

 

https://codegen.atlassian.net/rest/greenhopper/latest/integration/teamcalendars/sprint/list?jql=project=XYZ
SivaKumar Manickam June 25, 2020

what is the date format in the response?

senduran September 2, 2020

it is a hashcode and you cannot extract date from this. so u can get date for one sprint only. 

Alyssa Freeze September 30, 2021

@senduran Thank you!!

1 vote
senduran June 12, 2020

 

https://codegen.atlassian.net/rest/greenhopper/latest/integration/teamcalendars/sprint/list?jql=project=XYZ


I used something like this and receive all the sprints for a project.

but you cannot find the greenhoppers documentation now. it has been deprecated. but the url i mentioned above is still working.
krishan avtar gaur November 10, 2020

How can we get Status in side sprint ?

1 vote
Hector Agudo Mantilla March 5, 2018

Hello


You can see this link to resolve it:
https://docs.atlassian.com/jira-software/REST/7.0.4/#agile/1.0/sprint-createSprint

Kind regards

0 votes
Rostyk Chuma January 27, 2020
You can get SprintManager bean and then get list of sprints.

private static SprintManager getGreenHopperRapidManager() {
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 < bundles.length; i++) {
Bundle bundle = bundles[i];
if ("com.pyxis.greenhopper.jira".equals(bundle.getSymbolicName())) {
BundleContext bctx = bundle.getBundleContext();
try {
ServiceReference[] refs = bctx.getAllServiceReferences(null, null);
if (refs != null) {
for (int j = 0; j < refs.length; j++) {
Object prop = refs[j].getProperty("org.springframework.context.service.name");
if ("com.pyxis.greenhopper.jira".equals(prop)) {
ApplicationContext appCtx = (ApplicationContext) bctx.getService(refs[j]);
appCtx.getBeansOfType(SprintManager.class);
return (SprintManager) appCtx.getBean("sprintManagerImpl");
}
}
}
} catch (InvalidSyntaxException e) {
e.printStackTrace();
}
}
}
return null;
}
0 votes
Hany Hassan August 27, 2017

To get list of rapidviews in a project use : 

.../rest/greenhopper/latest/rapidviews/list?projectKey=PKY

Wilian Ricardo October 3, 2018

Muito obrigado...

Like Stan the man likes this

Suggest an answer

Log in or Sign up to answer