Skip to content

Commit

Permalink
Extract priorities from redmine responses appropriately.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphbean committed Nov 19, 2014
1 parent 0f11061 commit 6dccc13
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions bugwarrior/services/redmine.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ class RedMineIssue(Issue):
}
UNIQUE_KEY = (URL, )

PRIORITY_MAP = {
0: 'L',
1: 'L',
2: 'M',
3: 'H',
4: 'H',
}

def to_taskwarrior(self):
return {
'project': self.get_project_name(),
Expand All @@ -65,6 +73,12 @@ def to_taskwarrior(self):
self.ID: self.record['id']
}

def get_priority(self):
return self.PRIORITY_MAP.get(
self.record.get('priority', {}).get('id'),
self.origin['default_priority']
)

def get_issue_url(self):
return (
self.origin['url'] + "/issues/" + six.text_type(self.record["id"])
Expand Down

0 comments on commit 6dccc13

Please sign in to comment.