Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Recover the Default Group for the workspace

Hello, these last days we have been playing with the bitbucket API to adjust it to our needs. One of them is to know the default permissions granted to a new member.

I noticed that members are added to the default group, so we can achieve that by checking that group permissions.

However, we are not being able to recover which one of the groups of the workspace is the one selected as default. We can see it on the Web though.

Is there any workaround to achieve this? Thank you,

1 answer

1 accepted

0 votes
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Feb 27, 2023

Hi @José Antonio Garcel Díaz!

I don't think that it's possible to get via API which group is the default one at the moment, I will double-check with the development team and I'll let you know.

Please keep in mind the following about the default group:

The default group is the group where a user gets added if they are invited to a repo by a non-admin of the workspace. For example:

  1. UserA is an admin of repo https://bitbucket.org/my-workspace/my-repo/, but not an admin of the workspace https://bitbucket.org/my-workspace
  2. UserA invites UserB to said repo, via Repository settings > User and group access and grants UserB write access to the repo
  3. UserB accepts the invitation
  4. UserB then gets added to the default group

Even if the default group doesn't have access to any repo, UserB will continue to have access to https://bitbucket.org/my-workspace/my-repo/ as they were granted explicit access to said repo.

You can use the following API endpoint to get all explicit user permissions for a given repository:

Or the following API endpoint to get the explicit user permission for a given user and repository:

The following API endpoints will return explicit group permissions for a given repository, and explicit group permission for a given group slug and repository respectively:

If you have any questions, please feel free to let me know.

Kind regards,
Theodora

Hey @Theodora, I'm very grateful for getting your response, very clarificating. We were hopping to be able to recover the default goup though, so now we'll try to handle it in a different manner.

If you get an update on this from your Dev team I'll happy to know about.

 

Thanks again,

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Mar 03, 2023

Hi @José Antonio Garcel Díaz!

I had an update from the development team and I'm afraid that there is no API endpoint that provides a workspace's default group at the moment.

I went ahead and created a feature request about this in our issue tracker:

Please make sure to vote (by selecting the Vote for this issue link) and comment on it to give it more weight and further express your interest. You can also add yourself as a watcher (by selecting the Start watching this issue link) if you'd like to get notified via email on updates. Implementation of features is done as per our policy here and any updates will be posted in the feature request.

In the meantime, we have an internal API endpoint that you can use to retrieve the default group:

https://bitbucket.org/api/internal/workspaces/<workspace-slug>/default-group

Example:

curl -u BB_Username:App_Passowrd -X GET https://bitbucket.org/api/internal/workspaces/<workspace-slug>/default-group

The App_Passowrd needs to have at least Account: Write permissions to access that.

Please keep in mind though that since this is an internal API endpoint, we don't guarantee its behavior.

If you have any questions, please feel free to let me know.

Kind regards,
Theodora

Hey @Theodora. Just voted the issue!

We will try your workaround ASAP.

We really appreciated your support, thanks again.

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Mar 03, 2023

You are very welcome @José Antonio Garcel Díaz, I'm glad to have helped!

Please feel free to reach out if you ever need anything else!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events