Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

fetch comments on a pull-request using rest api (bitbucket server)

go-vinda
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 11, 2020

As per:

http://example.com/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments

In order to fetch comments on a PR, path is mandatory. In other words, it is only meant to fetch comments on files changed within a PR

We within our enterprise use Bitbucket server on-premise. We are keen to implement a Gitops style process on how we merge pull-requests. So it would be really helpful to get comments on the pull-request itself.

the comments can be commands/instructions very similar to prow project in kubernetes/test-infra.

 

So, need to fetch comments at PR level (instead of paths) would help.

 

Some workarounds have been identified in other questions/answers to use

http://example.com/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/activities

 

But this would be highly in-efficient as we may have to do increase page-limit to call and then make multiple calls if there are additional pages, and filter comments from all general activities.

 

Any help to simplify on how we could fetch comments at a PR level will help.

 

Best Regards,

Govinda

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events