Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(868)

Unified Diff: dashboard/dashboard/services/issue_tracker_service.py

Issue 2706813003: Add new endpoint to get bug details as JSON. (Closed)
Patch Set: addressed review comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dashboard/dashboard/elements/bug-details-test.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dashboard/dashboard/services/issue_tracker_service.py
diff --git a/dashboard/dashboard/services/issue_tracker_service.py b/dashboard/dashboard/services/issue_tracker_service.py
index 887b0da159cb2169b315250ad439ad4137ca3f8e..a4c3f51301c7bf5182ed103f34bf8893423b9ff8 100644
--- a/dashboard/dashboard/services/issue_tracker_service.py
+++ b/dashboard/dashboard/services/issue_tracker_service.py
@@ -170,6 +170,26 @@ class IssueTrackerService(object):
logging.error('Failed to create new bug; response %s', response)
return None
+ def GetIssueComments(self, bug_id):
+ """Gets all the comments for the given bug.
+
+ Args:
+ bug_id: Bug ID of the issue to update.
+
+ Returns:
+ A list of comments
+ """
+ if not bug_id or bug_id < 0:
+ return None
+ response = self._MakeGetCommentsRequest(bug_id)
+ if not response:
+ return None
+ return [{
+ 'author': r['author'].get('name'),
+ 'content': r['content'],
+ 'published': r['published']
+ } for r in response.get('items')]
+
def GetLastBugCommentsAndTimestamp(self, bug_id):
"""Gets last updated comments and timestamp in the given bug.
« no previous file with comments | « dashboard/dashboard/elements/bug-details-test.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698