Project sprints without the REST API

Hello,

I’m developing a JIRA addin to gather information on the progress of sprints as compared to estimations, company baselines, etc.

Currently I’m struggling with some of the basics. How can I get a list of sprints from a project. I’ve looked into the REST API and it is pretty straight forward, but I would like to do it completely without REST, being that it is an addon, not an external application retrieving data.

Hi,
For Jira Server there is jira-software-api and you can add it to you pom.

<dependency>
      <groupId>com.atlassian.jira.plugins</groupId>
      <artifactId>jira-software-api</artifactId>
      <version>1.32</version> <!-- 1.32 is version that goes with Jira Software 7.0.11 -->
      <scope>provided</scope>
    </dependency>

Looks like javadocs that I googled here are for prior Jira 7 versions but we were able to find what we needed.

Hello vkrupach and thanks for your prompt answer.

You seam to have pointed us in the correct direction. There’s just one thing I can’t make out. I haven’t been able to match the version you refer, 1.32, to any version of the jira-software-api from the Atlassian marketplace, so as to find the correct one for our JIRA version, 7.6.1. Can you shed some light on this?

Antonio,
I remember extracting the version from the sources. You can download appropriate Jira sources and find jira-greenhoper in the dependency folder and try to figure out appropriate version.

Recalled that I managed to extract the version from the development environment rather than from the sources.

  1. Run development instance that includes jira-software:


    You can put 7.6.1 instead of ${jira.version}

  2. Find the appropriate jira-software-api jar in the target dir:
    image

Hello and thanks for your help.

We did manage to get over the difficulties with loading the GreenHopper dependency, but could not figure out how to access instances of objects like RapidViewManager, SprintsManager, etc. We finally gave in to the fact that it is probably easier to use the REST API. At least there’s a lot more information on it…

Thanks any way

Antonio,
You should be able to inject them as any other external service. The old approach is to declare in atlassian-plugin.xml and there is corresponding annotation in spring-scanner approach but I do not have it in my head.

Hello and thanks again for your replies, but the thread seems to have gotten a bit off track. The issue was how to access the information. Although the suggestions about the refere to JIRA Software API seem be a possible solution, when exploring what it introduced in the project, we weren’t able to figure out how to instantiate the manager objects that we thought were needed. Objects like RapidViewManager, SprintManager, etc.

For stuff like projects and issues, the SDK’s object ComponentAccessor has methods, getProjectManager and getIssueManager, to retrieve instances of ProjectManager and IssueManager, but we couldn’t find the equivalent to in GreenHopper to instantiate objtects RapidViewManager, SprintManager, etc.