REST/GraphQL API for issue pull requests

I am working on a project which needs grab pull requests associated with a Jira issue. We have Bitbucket integrated with our Jira cloud instance, so we are able to view pull requests from Jira.

Unfortunately the XHR for the web request that returns this information is a seemingly proprietary GraphQL request. If I look it up on the GraphQL explorer, it requires the “jira:atlassian-external” scope, which I cannot find.

Perhaps I am barking up the wrong tree or haven’t found the right piece of documentation, but regardless this query would save me a lot of time and effort.

Is there a way I can have the “jira:atlassian-external” scope added to my OAuth application? Or, alternatively, is there a Jira/Bitbucket REST endpoint that accomplishes the same thing?

Welcome to the Atlassian developer community @JoeThatcher.

What you can see in the Jira UI about commits, branches, PRs, builds, deployments, and feature flags (collectively known as the Open DevOps APIs) is not currently available through APIs. Despite the name, the jira:atlassian-external scope is not available outside Atlassian.

You might be able to list pull requests using GET /2.0/repositories/{workspace}/{repo_slug}/pullrequests and the filtering options to search the commits and/or branches for your issue key.