Hello,
I am trying to create a simple dashboard for our organization which shows the logged-in user the tasks which are open in their plate. Below is an overview of what I am trying to do.
Question :
We are using the On-Premise Bitbucket server.
Is there a way to get all the PR's based on 'name' or 'email Id' using REST apis?
I looked into https://docs.atlassian.com/bitbucket-server/rest/5.16.0/bitbucket-rest.html, but couldn't find a way to solve my problem.
Any help will be greatly appreciated.
Thanks in advance,
Supreeth
It is possible, but you have to get all the pull requests and then sort them based on the user. You can use /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests to get your pull requests and then /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId} to get each individual PR. Look for author in the returned response.
@Mikael Sandberg Thanks a lot for the quick reply.
I have tried this endpoint.
But currently, our organization has 19 projects and in total 227 repositories and this number is bound to increase over time.
Since I am building a dashboard and expecting the data in real-time, iterating on all these repos is not a feasible solution.
Do you know any other way to narrow down the search?
Thanks and regards,
Hey @[deleted]you can try using the `/rest/api/1.0/dashboard/pull-requests` resource to get all the pull requests for the current logged in user:https://docs.atlassian.com/bitbucket-server/rest/7.0.1/bitbucket-rest.html#idp90
Thanks,Maciej
Hi @Maciej Adamczak - is there any way to get the dashboard for another user? For example, if you are a project manager and you want to be able to see all of the Pull Requests of the people on your team.
I also tried to see if the all-pull-requests had a REST API (as that should hopefully speed up @Mikael Sandberg 's suggestion) but I can't find any docs about a REST API for tht plugin.
Hi!
One of the ways to get all the PR's based on a username is by using the app called Awesome Graphs for Bitbucket. It allows you to export commit or pull request data into a CSV file or via REST API on the global, project, repository, or user level.
Kind regards,Uladzislava
It looks like you're new here. Sign in or register to get started.