Skip to content

Commit

Permalink
Merge pull request #185 from mmeisel/master
Browse files Browse the repository at this point in the history
Adds move_to_backlog from the agile API
  • Loading branch information
ssbarnea committed May 1, 2016
2 parents d9df096 + bd6c8f0 commit 5ff1110
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions jira/client.py
Expand Up @@ -3108,6 +3108,28 @@ def rank(self, issue, next_issue):
raise NotImplementedError('No API for ranking issues for agile_rest_path="%s"' %
self._options['agile_rest_path'])

def move_to_backlog(self, issue_keys):
"""
Move issues in ``issue_keys`` to the backlog, removing them from all
sprints that have not been completed.
:param issue_keys: the issues to move to the backlog
"""

if self._options['agile_rest_path'] == GreenHopperResource.AGILE_BASE_REST_PATH:
url = self._get_url('backlog/issue', base=self.AGILE_BASE_URL)
payload = {'issues': issue_keys}
try:
self._session.post(url, data=json.dumps(payload))
except JIRAError as e:
if e.status_code == 404:
warnings.warn('Status code 404 may mean, that too old JIRA Agile version is installed.'
' At least version 6.7.10 is required.')
raise
else:
raise NotImplementedError('No API for moving issues to backlog for agile_rest_path="%s"' %
self._options['agile_rest_path'])


class GreenHopper(JIRA):

Expand Down

0 comments on commit 5ff1110

Please sign in to comment.