Hi Srinath, you can automate this by using the Bitbucket REST API, but you'll need to authenticate. The Bitbucket API grants access to public data without authentication, but access to private data requires the caller to authenticate under an account with the appropriate access. Adding or changing branch permissions requires project admin privileges.
You can find more information about the REST API at https://developer.atlassian.com/static/rest/bitbucket-server/latest/bitbucket-rest.html#idm45669359596592 (if you're using Bitbucket Server) or https://developer.atlassian.com/cloud/bitbucket/about-bitbucket-cloud-rest-api/ (if you're using Bitbucket Cloud).
Hope that helps!
Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot