Is there any REST endpoint to make repos and projects public or private?
Essentially looking for an automated way to accomplish this setting, and can't find it in REST API Docs.
Thanks,
I found one api -
http://bitbucket.example/rest/api/latest/projects/{projectSlug}/repos/{repoSlug} (PUT)
request payload- {public: true}.
It is documented here-
https://developer.atlassian.com/static/rest/bitbucket-server/4.6.1/bitbucket-rest.html#idp457424
If you try to make an repository public from bitbucket-server UI , then do inspect element, and see UI is also calling this API only/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ed,
We have a way to do that through a permissions update script using ScriptRunner for Bitbucket Server.
You can also set it for all future by extending the repository creation event using our event handler too.
regards,
Mark.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's a viable answer while not directly answering the question we have scriptrunner installed and provides a method for accomplishing our larger task.
Thanks for the answers!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here's the catch if your project is public tweaking any repo to private will require the project to be private which in effect makes ALL repos private!
Another catch is if you tweak the project to private it has to stay private. Tweaking it back public after setting your repo private will reset the repo setting or make it public again.
Is there any way to differentiate this setting at the repo level.
Also what is the API endpoint for setting the project permission to private? It is not obvious from inspection as appears to use a class.
Thanks.
-Walt Shekrota
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.