Skip to content

Commit c79e695

Browse files
committed
add sorting to comments endpoint
1 parent 060c591 commit c79e695

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

atlassian/bitbucket/cloud/repositories/pullRequests.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,16 +275,20 @@ def builds(self):
275275

276276
return
277277

278-
def comments(self, q=None):
278+
def comments(self, q=None, sort=None):
279279
"""
280280
Returns generator object of the comments endpoint
281281
282282
:param q: string: Query string to narrow down the response.
283-
See https://developer.atlassian.com/bitbucket/api/2/reference/meta/filtering for details.
283+
:param sort: string: Name of a response property to sort results.
284+
See https://developer.atlassian.com/bitbucket/api/2/reference/meta/filtering
285+
for details on filtering and sorting.
284286
285287
API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D/comments#get
286288
"""
287289
params = {}
290+
if sort is not None:
291+
params["sort"] = sort
288292
if q is not None:
289293
params["q"] = q
290294
for comment in self._get_paged("comments", params=params):

0 commit comments

Comments
 (0)