Through the UI:
On the commit url (at the top right of the page, there is a section that will show the related issues, next to a JIRA icon.
Sorry I didn't realise you were looking for an API.
The REST APIs available for Bitbucket JIRA integration can be found here:
Unfortunately, it does not contain a way to get the issues via a commit hash. In order to do that, you need to call
getIssuesForCommit from the
JiraIssueService. See https://developer.atlassian.com/static/javadoc/bitbucket-server/latest/jira-api/reference/com/atlassian/bitbucket/integration/jira/JiraIssueService.html for more details.
Hi @Rinkal Garg,
To access the API you need to write a Bitbucket Plugin (see https://developer.atlassian.com/server/bitbucket/how-tos/beginner-guide-to-bitbucket-server-plugin-development/ for details).
You can depend on the jar by adding the dependency in your pom.xml
You would then need access to the JiraIssueService from your code (you'd probably wire this up using osgi) and you can call it with something along the lines of:
Set<JiraIssue> issues = jiraIssueService.getIssuesForCommits(ImmutableSet.of("111c0f1b97df94995b91f236300e4ae7f3ddf993", "dd25dda3131911ad842e0b828bff4825fae216e1"));
Hope that helps,
I tried your solution above however, I have trouble accessing JiraIssueService.
I tried Component-Import (No qualifying bean of type 'com.atlassian.bitbucket.integration.jira.JiraIssueService')
I tried ComponentLocator but I got null
I dont know where to start fixing to be able to access JiraIssueService
Hello @jv villacorta
I faced the same issue.
I fixed it by adding to the pom.xml the following missing plugin:
Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events