Skip to content

Commit

Permalink
Merge pull request #163 from ralphbean/feature/bz-id-uda
Browse files Browse the repository at this point in the history
Add bugzilla bug id as a UDA.
  • Loading branch information
ralphbean committed Nov 25, 2014
2 parents d0e6083 + ea50d71 commit c56ae0b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions bugwarrior/docs/services/bugzilla.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ Provided UDA Fields
+---------------------+---------------------+---------------------+
| ``bugzillaurl`` | URL | Text (string) |
+---------------------+---------------------+---------------------+
| ``bugzillabugid`` | Bug ID | Numeric (integer) |
+---------------------+---------------------+---------------------+
8 changes: 7 additions & 1 deletion bugwarrior/services/bz.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
class BugzillaIssue(Issue):
URL = 'bugzillaurl'
SUMMARY = 'bugzillasummary'
BUG_ID = 'bugzillabugid'

UDAS = {
URL: {
Expand All @@ -19,7 +20,11 @@ class BugzillaIssue(Issue):
SUMMARY: {
'type': 'string',
'label': 'Bugzilla Summary',
}
},
BUG_ID: {
'type': 'numeric',
'label': 'Bugzilla Bug ID',
},
}
UNIQUE_KEY = (URL, )

Expand All @@ -39,6 +44,7 @@ def to_taskwarrior(self):

self.URL: self.extra['url'],
self.SUMMARY: self.record['summary'],
self.BUG_ID: self.record['id'],
}

def get_default_description(self):
Expand Down
4 changes: 3 additions & 1 deletion tests/test_bugzilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def test_to_taskwarrior(self):
arbitrary_record = {
'component': 'Something',
'priority': 'urgent',
'summary': 'This is the issue summary'
'summary': 'This is the issue summary',
'id': 1234567,
}
arbitrary_extra = {
'url': 'http://path/to/issue/',
Expand All @@ -41,6 +42,7 @@ def test_to_taskwarrior(self):

issue.URL: arbitrary_extra['url'],
issue.SUMMARY: arbitrary_record['summary'],
issue.BUG_ID: arbitrary_record['id']
}
actual_output = issue.to_taskwarrior()

Expand Down

0 comments on commit c56ae0b

Please sign in to comment.