Am looking for an API that pulls the data from the whole workspace where an user is added as a reviewer to the PR and approved the PR
There is no single Bitbucket Cloud API endpoint that directly returns all PRs approved by a specific user across a workspace. However, you can achieve this with the following approach:
1. Use the workspace pull requests endpoint to get all PRs for the workspace:
GET https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pullrequests
You will need to call this for each repository in the workspace, or use the workspace-level endpoint to list all repositories first.
2. Each PR object returned includes a "reviewers" array. You need to iterate through the results and filter for entries where the specific user appears in the reviewers array with their approval status set to "approved".
Hello and welcome to the Community @venukishorereddy_b
The closest workspace-level endpoint, /2.0/workspaces/{workspace}/pullrequests/{selected_user}, only returns pull requests authored by that user.
It does not return PRs where that user was a reviewer or approver. Atlassian also has an open suggestion for that exact gap
https://jira.atlassian.com/browse/BCLOUD-21950
Take look also here for some helpful Tips:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any timeline on this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We know as much as you. We working with Atlassian Tools, not For Atlassian.
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.