The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Aron Gombas _Midori_
Community Champion
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 

DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events