REST API between Jira and Bitbucket

Is it possible to get a list of all the repositories that have development changes associated with a given version?

Let me explain…

When I view a Jira, if there are any associated commits or pull requests in my linked Bitbucket server, it displays a summary of those commits/PRs in the development tab. This is very useful.

Secondly, when I create a version (release), I can view a summary of that version in Jira and it will list all the associated PRs and what their status is, helping me see any potential issues with the release.

I assume all of this is working off of the PR name and/or commit messages having the Jira ID in them. I’m also assuming that Bitbucket is exposing some kind of API that Jira is consuming to display this information.

I would like to take this further and use this Jira/Bitbucket association to cut release branches accross dozens of repositories. When we create a version, I would like to be able to automatically cut a new release branch in bitbucket for all repositories that have associated development changes.

I’m envisaging the flow to be something like…

  1. Query Jira API to get a list of Jira Ids associated with a given version
  2. Query Bitbucket API to get a list of repositories that have commits/PRs on the develop branch associated with one or more of the Jira IDs.

Is this possible? Any suggestions how to achieve this appreciated.