Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to get all sprints in project using JIRA REST API

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

6 votes
Answer accepted

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.

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

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.

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

what is the date format in the response?

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

 

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.

How can we get Status in side sprint ?

To get list of rapidviews in a project use : 

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

Muito obrigado...

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;
}

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you