-
Bug
-
Resolution: Fixed
-
Low
-
None
-
1
-
Severity 3 - Minor
-
12
-
Issue Summary
The List pull requests REST API endpoint does not include draft pull requests in its response.
Steps to Reproduce
- Create a draft pull request
- Use the List pull requests endpoint to fetch open pull requests for the repository:
https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pullrequests?state=OPEN
Expected Results
The API response should include all open pull requests for the repository, both draft and non-draft.
Actual Results
The response only includes non-draft open PRs, i.e. those with
"draft": false
Workaround
To request draft pull requests from the REST API, format your request like this:
https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pullrequests?q=state%3D%22OPEN%22%20AND%20draft%3Dtrue
To request all open pull requests (both draft and non-draft), format your request like this:
https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pullrequests?q=state%3D%22OPEN%22%20AND%20(draft%3Dtrue%20OR%20draft%3Dfalse)
- relates to
-
BCLOUD-12503 "Work in progress" / "draft" state for pull requests
- Closed
- is caused by
-
COREX-11134 Loading...