1
votes

I'm trying to get the list of sprints associated to a given board (as described in JIRA Python module documentation examples):

sprints = gh.sprints(board_id)

where board_id is the ID of the board to be retrieved (1175 for reference), previously retrieved as with jira.boards().

I'm getting the following error:

  File "C:\Python27\lib\site-packages\jira\exceptions.py", line 49, in raise_on_error
    raise JIRAError(r.status_code, error, r.url)
jira.exceptions.JIRAError: HTTP 404: "<?xml version="1.0" encoding="UTF-8" standalone="yes"?><status><status-code>404</status-code><message>null for uri: https://jirafoo.bar.com/rest/greenhopper/1.0/sprintquery/1175?includeHistoricSprints=true&amp;includeFutureSprints=true</message></status>"
https://jirafoo.bar.com/rest/greenhopper/1.0/sprintquery/1175?includeHistoricSprints=true&includeFutureSprints=true

(I'm using jirafoo.bar.com to ofuscate the actual hostname of the JIRA server)

Any clues about what can be the cause, please? Thanks!

EDIT: reference information about JIRA server version, just in case it helps:

Agile project management for Kanban and Scrum software development powered by Atlassian GreenHopper (v6.1.6). Bug tracking and project tracking for software development powered by Atlassian JIRA (v5.1.1#772-sha1:c73db67)

EDIT: I have found that using this URL directly (e.g. in my browser) I'm getting a JSON with the list of the sprints:

https://jirafoo.bar.com/rest/greenhopper/1.0/sprints/1175

Maybe the JIRA module is not using the right URL for the sprints() method (I understand that this would be a bug in the JIRA python library)? Or maybe I'm using the wrong method on the gh object? My Python JIRA module version is 0.32 (I think the most recent one at time of writting this).

1
I have opened an issue in source code repository related with this at bitbucket.org/bspeakmon/jira-python/issue/138/…fgalan

1 Answers

3
votes

I had the same problem and could not find the answer anywhere.

Your question made me realize that the URL was the problem. It called "/sprintquery/" while the URL you posted is "/sprints/"

I finally implemented the fix myself on my computer. I've backup the file :

/Library/Python/2.7/site-packages/jira/client.py

and modified the following line:

r_json = self._get_json('sprintquery/%s?includeHistoricSprints=true&includeFutureSprints=true' % id,
                                base=self.AGILE_BASE_URL)

for this one:

r_json = self._get_json('sprints/%s?includeHistoricSprints=true&includeFutureSprints=true' % id,
                                base=self.AGILE_BASE_URL)