Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Rest API for getting list of jira issues present in PR on Bitbucket cloud

Arun Jagtap August 21, 2022

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}/issues

Retrieves 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

PATH PARAMETERS
projectKey REQUIRED

string

The project key

pullRequestId REQUIRED

string

The pull request id

repositorySlug REQUIRED

string

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.

3 answers

2 accepted

1 vote
Answer accepted
Nemanja Trivic October 31, 2022

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}
Arun Jagtap November 7, 2022

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.

0 votes
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 6, 2022

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

Arun Jagtap November 7, 2022

Thanks for Reply @Theodora Boudale 

sure I'll add it.

Like Theodora Boudale likes this
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 8, 2022

You are very welcome, please feel free to reach out if you ever need anything else.

Like Arun Jagtap likes this
0 votes
Arush Soel January 9, 2023

Below API is available for Bitbucket Server and is not present in Bitbucket cloud.

 

Is there any update regarding its cloud api endpoint?

Arush Soel January 9, 2023

@Theodora Boudale  wanted a cloud api to find jira issues associated with a pr?

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 10, 2023

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

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events