-
Type:
Suggestion
-
Resolution: Unresolved
-
None
-
Component/s: API - REST, Integration – Build Status
-
None
-
3
Current behaviour
- There is no REST API available to retrieve build statuses for a particular Pull Request.
- Previously, the workaround was:
- Get the latest commit of the Pull Request using the Get pull request endpoint.
- Using the commit, retrieve the build statuses.
After the Get build statuses for commit endpoint was deprecated, there is no longer a way to retrieve build statuses for a particular commit.
Suggested behaviour
- Provide an endpoint for the following scenario:
- Get build statuses for a Pull Request.
- Get build statuses for a commit.
Workaround
Please be aware that the following are not REST API endpoints; they are UI endpoints. As such, they are subject to change at any time in the future. These endpoints are undocumented and are not recommended for use in scripts, as they may change unpredictably.
- To retrieve build statuses for a Pull Request:
GET $BASE_URL/rest/ui/latest/projects/$PROJECT_KEY/repos/$REPO_SLUG/pull-requests/$PR_ID/builds?start=0&limit=25 - To retrieve build statuses for a commit:
GET $BASE_URL/rest/ui/latest/projects/$PROJECT_KEY/repos/$REPO_SLUG/builds?at=$COMMIT_HASH&start=0&limit=25
- relates to
-
BSERV-19724 Provide a new API endpoint to obtain all the builds for a given commit
- Gathering Interest