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

How to list open PR for a branch using API

sidhant July 24, 2023

i was trying to get the list of open pull request for a branch. i tried hitting this API 

GET /2.0/repositories/{username}/{repository_slug}/pullrequests?state=OPEN&source.branch.name={branch_name}

i got this response: 
{"type": "error", "error": {"message": "Your credentials lack one or more required privilege scopes.", "detail": {"required": ["pullrequest"], "granted": ["repository:delete", "repository:admin", "repository:write"]}}}

1 answer

0 votes
Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 25, 2023

The message means that whatever authentication you used, it is not permitted to work with pull requests.

"required": ["pullrequest"]

...means that you need the "pullrequest" scope to make this REST API call.

sidhant July 25, 2023

yeah but I already have admin access for this but still it is not inheriting all the write access 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events