add Issue.fields attribute to support custom fields
This commit is contained in:
parent
370c8ec0e6
commit
02f40ccf2c
4 changed files with 54 additions and 4 deletions
|
|
@ -189,6 +189,9 @@ class RedmineBackend(BaseBackend, ICapContent, ICapBugTracker, ICapCollection):
|
|||
issue.body = params['body']
|
||||
issue.creation = params['created_on']
|
||||
issue.updated = params['updated_on']
|
||||
issue.fields = {}
|
||||
for key, value in params['fields'].iteritems():
|
||||
issue.fields[key] = value
|
||||
issue.attachments = []
|
||||
for a in params['attachments']:
|
||||
attachment = Attachment(a['id'])
|
||||
|
|
@ -220,12 +223,14 @@ class RedmineBackend(BaseBackend, ICapContent, ICapBugTracker, ICapCollection):
|
|||
def create_issue(self, project):
|
||||
try:
|
||||
with self.browser:
|
||||
r = self.browser.query_issues(project)
|
||||
r = self.browser.get_project(project)
|
||||
except BrowserHTTPNotFound:
|
||||
return None
|
||||
|
||||
issue = Issue(0)
|
||||
issue.project = self._build_project(r['project'])
|
||||
issue.project = self._build_project(r)
|
||||
with self.browser:
|
||||
issue.fields = self.browser.get_custom_fields(project)
|
||||
return issue
|
||||
|
||||
def post_issue(self, issue):
|
||||
|
|
@ -237,6 +242,7 @@ class RedmineBackend(BaseBackend, ICapContent, ICapBugTracker, ICapCollection):
|
|||
'category': issue.category,
|
||||
'status': issue.status.id if issue.status else None,
|
||||
'body': issue.body,
|
||||
'fields': issue.fields,
|
||||
}
|
||||
|
||||
with self.browser:
|
||||
|
|
@ -291,7 +297,6 @@ class RedmineBackend(BaseBackend, ICapContent, ICapBugTracker, ICapCollection):
|
|||
return self._build_project(params['project'])
|
||||
|
||||
def fill_issue(self, issue, fields):
|
||||
# currently there isn't cases where an Issue is uncompleted.
|
||||
return issue
|
||||
return self.get_issue(issue)
|
||||
|
||||
OBJECTS = {Issue: fill_issue}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue