Below API is available for Bitbucket Server and is not present in Bitbucket cloud.
GET /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/issuesRetrieves Jira issue keys that are associated with the commits in the specified pull request. The number of commits checked for issues is limited to a default of 100.RequestPATH PARAMETERSprojectKey REQUIREDstringThe project keypullRequestId REQUIREDstringThe pull request idrepositorySlug REQUIREDstringThe repository slugWe wanted the similar information about the Jira issues present in the raised pull request.There isn't anything on this in the documentation, but let me know if it's already there or something related to it.
GET /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/issuesRetrieves Jira issue keys that are associated with the commits in the specified pull request. The number of commits checked for issues is limited to a default of 100.Request
string
The project key
The pull request id
The repository slug
We wanted the similar information about the Jira issues present in the raised pull request.There isn't anything on this in the documentation, but let me know if it's already there or something related to it.
Hi Arun,
I'm afraid that we don't have an API endpoint to get Jira issues associated with a PR. You can find those issues on the website only at the moment while viewing a certain PR, on the right-hand panel titled Details.
We have a feature request to provide such an API endpoint: https://jira.atlassian.com/browse/BCLOUD-20183
The request has been closed due to inactivity, but I would suggest leaving a comment there and adding your vote (by selecting the Vote for this issue link), as our product managers continue to monitor even closed requests.
Kind regards,Theodora
The only relatively practical solution i know of is to parse jira ID from PR name yourself.
I assume you are getting PR ID from bitbucket pipelines. So using this endpoint you can get PR title:
https://bitbucket.org/!api/2.0/repositories/{workspace_slug}/{repository_slug}/pullrequests/{pr_id}
Here is the regex pattern used for parsing issue IDs https://confluence.atlassian.com/bitbucketserverkb/integrating-with-custom-jira-issue-key-in-bitbucket-server-779171880.html
So when u parse issue ID from PR title you can just hit Jira API endpoint like this:
/rest/api/2/issue/{issue_id}
Hey Thanks for reply @Nemanja Trivic ,yeah we have used similar kind of workaround for that.as Bitbucket cloud API would have make more sense of us instead by creating such workaround.so looking forward availability of desired API.
Thanks for Reply @Theodora Boudale sure I'll add it.
You are very welcome, please feel free to reach out if you ever need anything else.
Is there any update regarding its cloud api endpoint?
@Theodora Boudale wanted a cloud api to find jira issues associated with a pr?
Hi @Arush Soel,
It is not possible to get Jira issues associated with a PR via API in Bitbucket Cloud.
Please add a comment to the following feature request to express your interest: https://jira.atlassian.com/browse/BCLOUD-20183
It looks like you're new here. Sign in or register to get started.