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
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 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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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,
Supreeth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@J. E. Unfortunately Bitbucket doesn't have a REST endpoint that works with all the pull requests. The only supported REST API is the one for a repository pull requests: https://docs.atlassian.com/bitbucket-server/rest/7.5.0/bitbucket-rest.html#idp291
As for accessing a dashboard of another user, Bitbucket doesn't have this feature either.
Thanks,
Maciej Adamczak
Bitbucket Developer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm interested in this as well. Basically I'm looking for a rest call that lists all the PRs on the page: /plugins/servlet/all-pull-requests/all?state=open
We're in a similar situation with lots of projects and repos. Individually requesting PRs in each repo is not practical.
It's possible to parse the above page and get what I want, but that will be very hacky and error prone
@[deleted] did you find a solution for this?
Thanks,
Eric Smith
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.