Skip to content

Commit

Permalink
Add fields id, status & url for Redmine bug details
Browse files Browse the repository at this point in the history
API: when integration with a 3rd party bug tracker is configured
correctly the Bug.details() API method will now return the additional
fields `id`, `status` and `url` alongside the existing `description` and
`title`!

Refs #3748
  • Loading branch information
atodorov committed Nov 7, 2024
1 parent da2d7b1 commit dc979ea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion tcms/issuetracker/tests/test_redmine.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@ def test_bug_id_from_url(self):
def test_details_for_url(self):
result = self.integration.details(self.existing_bug_url)

self.assertEqual("Hello Redmine", result["title"])
self.assertEqual(self.existing_bug_id, result["id"])
self.assertEqual("Created via API", result["description"])
self.assertEqual("OPEN", result["status"])
self.assertEqual("Hello Redmine", result["title"])
self.assertEqual(self.existing_bug_url, result["url"])

def test_auto_update_bugtracker(self):
issue = self.integration.rpc.issue.get(self.existing_bug_id)
Expand Down
5 changes: 4 additions & 1 deletion tcms/issuetracker/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,11 @@ def details(self, url):
try:
issue = self.rpc.issue.get(self.bug_id_from_url(url))
return {
"title": issue.subject,
"id": issue.id,
"description": issue.description,
"status": issue.status.name,
"title": issue.subject,
"url": url,
}
except redminelib.exceptions.ResourceNotFoundError:
return super().details(url)
Expand Down

0 comments on commit dc979ea

Please sign in to comment.