Forums

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

Branch Permission

Jayaraj Wilson April 13, 2020

 

I would like to write a script and/or golang program that can access the bitbucket cloud repo and modify the permission to

- add one or more user to the Merge via pull request option
- remove one or more user from the Merge via pull request option
- allow Write Access to a branch for one or more user

Am sure some api's exist and would appreciate if someone points me to the right path.

2 answers

0 votes
Jimmy Seddon
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 13, 2020

Hi @Jayaraj Wilson,

Here is the REST API documentation for BitBucket Cloud, specifically looking at a pullrequest by id:

https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D

I hope that's what you were looking to find.

-Jimmy

0 votes
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 13, 2020

Hello @Jayaraj Wilson ,

Here's the endpoint to create branch permission, and here's the one to modify an existing one.

All three use cases you described refer to updating a branch restriction, so the latter endpoint is what you're looking for.

Hope this helps.

Cheers,
Daniil

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events