-
Type:
Suggestion
-
Resolution: Unresolved
-
Component/s: API Framework - Querying
-
None
Summary
Currently, the Bitbucket Cloud REST API provides endpoints to retrieve commit details (e.g., /2.0/repositories/{workspace}/{repo_slug}/commit/{commit_sha}{}), but the response does not include information about which branches the commit is part of and the parent branch. In the Bitbucket UI, this information is visible when viewing a commit, but it is not available via the API. The Jira issue keys also not available.
Use Case
For automation, integrations, and CI/CD workflows, it is important to programmatically determine which branches contain a specific commit and Jira issue keys. This is especially useful for tracking deployments, release management, and branch maintenance.
Current Workaround
The only workaround is to:
- Retrieve the list of all branches using the The Bitbucket Cloud REST API.
- For each branch, use the The Bitbucket Cloud REST API to check if the commit is present in that branch.
- Use REGEX to get the pattern for the issue keys from the commit message.