Skip to content

Commit

Permalink
Phabricator: Use priorities of issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Schridde authored and ryneeverett committed May 20, 2018
1 parent eddc690 commit 58da68f
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion bugwarrior/services/phab.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,19 @@ class PhabricatorIssue(Issue):
}
UNIQUE_KEY = (URL, )

PRIORITY_MAP = {
'Needs Triage': None,
'Unbreak Now!': 'H',
'High': 'H',
'Normal': 'M',
'Low': 'L',
'Wishlist': 'L',
}

def to_taskwarrior(self):
return {
'project': self.extra['project'],
'priority': self.origin['default_priority'],
'priority': self.priority,
'annotations': self.extra.get('annotations', []),

self.URL: self.record['uri'],
Expand All @@ -57,6 +66,11 @@ def get_default_description(self):
cls=self.extra['type'],
)

@property
def priority(self):
return self.PRIORITY_MAP.get(self.record.get('priority')) \
or self.origin['default_priority']


class PhabricatorService(IssueService):
ISSUE_CLASS = PhabricatorIssue
Expand Down

0 comments on commit 58da68f

Please sign in to comment.