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.

Have there been any changes to this? I also need a way to fetch PRs associated with Issues via OAuth app. I’ve spent the last week searching for a valid API call, and there seem to be two approaches to getting this data that don’t ultimately work for OAuth tokens:

  1. Use this seemingly private, undocumented API, which works in my browser when logged in, but not with an OAuth token (/rest/dev-status/latest/issue/detail?issueId={{issueId}}&applicationType=GitHub&dataType=branch)
  2. Use the GraphQL API – but, as this thread already points out, you need jira:atlassian-external scope, which isn’t an available scope for OAuth apps

I’m using the GitHub integration – is there an alternative approach?

@jake1,

No official change. I’m not aware of any hidden workarounds either.