Skip to content

Commit

Permalink
Merge pull request #108 from coddingtonbear/handle_jira_priority_more…
Browse files Browse the repository at this point in the history
…_gracefully

Handle JIRA priority slightly more gracefully.
  • Loading branch information
ralphbean committed Mar 24, 2014
2 parents 496f881 + 277a885 commit 3008ce1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bugwarrior/services/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ def get_summary(self):
return self.record['fields']['summary']

def get_priority(self):
if self.extra.get('jira_version') == 4:
value = self.record['fields'].get('priority', {}).get('name')
else:
value = self.record['fields'].get('priority')
value = self.record['fields'].get('priority')
if isinstance(value, dict):
value = value.get('name')
elif value:
value = str(value)

return self.PRIORITY_MAP.get(value, self.origin['default_priority'])

Expand Down

0 comments on commit 3008ce1

Please sign in to comment.