Skip to content

Commit

Permalink
Merge pull request #50 from ubuntudroid/develop
Browse files Browse the repository at this point in the history
Can now define prefix to be added to project name of pulled Jira tasks
  • Loading branch information
ralphbean committed Feb 19, 2013
2 parents 3d0c8f4 + 34400d7 commit 6e08dd3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions bugwarrior/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ Create a ``~/.bugwarriorrc`` file with the following contents.
jira.username = ralph
jira.password = OMG_LULZ
jira.query = assignee = ralph and status != closed and status != resolved
jira.project_prefix = Programming.

# Here's an example of a teamlab target.
[my_teamlab]
Expand Down
3 changes: 2 additions & 1 deletion bugwarrior/services/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def __init__(self, *args, **kw):
self.url = self.config.get(self.target, 'jira.base_uri')
default_query = 'assignee=' + self.username + ' AND status != closed and status != resolved'
self.query = self.config.get(self.target, 'jira.query', default_query)
self.project_prefix = self.config.get(self.target, 'jira.project_prefix', '')
self.jira = JIRA(options={'server': self.config.get(self.target, 'jira.base_uri')},
basic_auth=(self.username,
self.config.get(self.target, 'jira.password')))
Expand Down Expand Up @@ -74,7 +75,7 @@ def issues(self):
url=self.url + '/browse/' + case.key,
number=case.key.rsplit('-', 1)[1], cls="issue",
),
project=case.key.rsplit('-', 1)[0],
project=self.project_prefix + case.key.rsplit('-', 1)[0],
priority=self.priorities.get(
get_priority(case.fields.priority),
self.default_priority,
Expand Down

0 comments on commit 6e08dd3

Please sign in to comment.