How to remove inactive users from a Bitbucket Cloud Workspace
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
There will be some scenarios where a workspace admin will find some 'INACTIVE' users when exporting the list of users from a given workspace.
If those users have direct access to repositories under the workspace, they will still show even after removing the users from all user groups.
Identifying to which repositories each user has access could be a painful process.
Solution
There are two known ways of removing 'INACTIVE' users with direct access to repositories:
1 - Use the Bitbucket Cloud API:
To achieve that, as a preparation step, you will have to gather the UUID for the users you want to remove access.
This can be acquired through the API below, which also returns the inactive users from the workspace:
Then, to remove all access to those users from your workspace, you can use the following script:
Just a disclaimer, this tool was NOT written by Atlassian developers and is considered a third-party tool. This means that this is also NOT supported by Atlassian. We highly recommend you have your team review the script before running it to ensure you understand the steps and actions taking place, as Atlassian is not responsible for the resulting configuration.
2 - Create a temporary group:
Add all 'INACTIVE' users to the newly created group.
Access the Workspace settings.
Click on 'User groups' under 'Access management'.
Then, for each user, after clicking on the 'View access' button, it is possible to remove all repositories direct access permissions.
Finally, delete the group, and those 'INACTIVE' users will no longer be part of the workspace.
Was this helpful?