API to list Bitbucket Deployments does not return all values
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
The API endpoint 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/deployments/'
is used to list deployments on a specific repository。
However, it might not contain all the build details, even though a specific build was deployed. In this article, we will understand the reason for this behavior.
Diagnosis
Using the API, when you fetch the list of deployments, not all are returned.
Cause
This is because the build artifact has expired. The list deployment API will exclude the expired deployment. For other builds, the deployment has not yet expired; hence, it is included in the API response.
Solution
Run a new build that contains an artifact, the build number will display in the API output.
Was this helpful?