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: 

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Jimmy Seddon
Community Champion
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

TAGS
AUG Leaders

Atlassian Community Events