How do I find which users count against my Bitbucket Data Center license?
Platform Notice: Data Center and Cloud By Request - This article was written for the Atlassian data center platform but may also be useful for Atlassian Cloud customers. If completing instructions in this article would help you, please contact Atlassian Support and mention it.
サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
The content on this page relates to supported platforms; however, the content is out of the scope of our Atlassian Support Offerings. Consequently, Atlassian can't guarantee support. Please be aware that this material is provided for your information only, and you may use it at your own risk.
要約
If you log in as a Bitbucket administrator and go to Administration > Licensing, you will see the number of licensed users. The User limit field displays the maximum number of licensed users you can have. The Licensed user's field will display the number of users consuming a license. Once exhausted, these two field values will match, indicating you've run out of user licenses. This page informs you how to find which users are counted against your license.
ソリューション
Since Bitbucket 8.12.x, you can search for and filter out licensed users on the Administration > Users page.
Check the Licensed column to find out if a user is licensed. You can also use filters to find users by their license statuses, last authentication time, and directory. In the Export menu, apart from the users and user permissions options, you can now select Users (Filtered results) to export the data on the users you've filtered out.
You can also check how many free seats your license is providing. To do this, use the JMX metrics for licensed users statistics.
Other methods
If you haven't upgraded to Bitbucket 8.12.x or later, you can use a few other methods to find licensed users in your instance.
Method #1 (Bitbucket 5.2.0+ only): Install the Centralized License Visibility app
Install the Centralized License Visibility app:
- Log in to Bitbucket as an administrator and go to Administration > Find new apps.
- Search for "centralized license visibility".
- Select Install.
Once the app is installed, it will begin to populate the necessary tables for use. If your instance has 100k users, this may take up to 10 minutes, so 15-20 minutes should be adequate time before proceeding to the next steps.
Run the following queries against the database.
The SQL queries below are for example purposes. If your database type is not represented, please work with your database administrator (DBA) to construct the appropriate query for your database.
Licensed users count
To get the number of licensed users, run the following queries:
SELECT "VERSION", COUNT(*) FROM "AO_A020FF_LICENSED_USER" GROUP BY "VERSION" ORDER BY 1 DESC;
SELECT version, COUNT(*) FROM AO_A020FF_LICENSED_USER GROUP BY version ORDER BY 1 DESC;
The app always maintains the last two sets of licensed users collected. Hence, the first row of the output shows the latest licensed user count in descending sort by version.
The table will be refreshed 24 hours after the last run of the app.
Licensed user details
To get licensed user details (the username, display name, email address, and last login timestamp), run the following queries:
SELECT * FROM "AO_A020FF_LICENSED_USER" WHERE "VERSION" = (SELECT MAX("VERSION") FROM "AO_A020FF_LICENSED_USER");
SELECT * FROM AO_A020FF_LICENSED_USER WHERE VERSION = (SELECT MAX(VERSION) FROM AO_A020FF_LICENSED_USER);
Licensed users data refresh
To force the table refresh, use the following REST endpoint:
curl -u <admin-user> -X POST <bitbucket_url>/rest/panopticon/1.0/scheduler/collect-data
Alternatively, you can disable and then re-enable the plugin. After one minute, the plugin will run to refresh the table.
Method #2 (Bitbucket 5.2.0+ only): Install the User Permission Debugger app
The Bitbucket development team wrote a small plugin that will help determine what users Bitbucket sees:
- Log in to Bitbucket as an administrator and go to Administration > Manage Add-ons.
- Select Upload add-on.
- Paste the following URL to the From this URL field and select Upload: https://packages.atlassian.com/maven/com/atlassian/bitbucket/plugins/user-permission-debugger/0.9.0/user-permission-debugger-0.9.0.jar
You can also go to the link to download the jar and use the upload option. Wait for the plugin to install.
Browse to
<bitbucket_url
>/plugins/servlet/users-with/LICENSED_USER,
which will display the active licensed users.
The plugin is restricted to Bitbucket administrators. It can be uninstalled from the Manage apps screen if preferred.
Method #3: REST API
You may want to get the number of licenses being consumed and when the license will expire via a script. You may want this script to start sending emails when 90% of your user tier is utilized or when the license will expire within three months, for example.
To achieve that, you can use the REST API endpoint /rest/api/1.0/admin/license
to get the following:
maximumNumberOfUsers
– your upper bound for your current ongoing license.-
currentNumberOfUsers
– the number of licensed users in the system:
curl -u username:password -X GET <bitbucket_url>/rest/api/1.0/admin/license
{
"creationDate": 1532872800000,
"purchaseDate": 1532872800000,
"expiryDate": null,
"numberOfDaysBeforeExpiry": 2147483647,
"maintenanceExpiryDate": 1564408800000,
"numberOfDaysBeforeMaintenanceExpiry": 203,
"gracePeriodEndDate": null,
"numberOfDaysBeforeGracePeriodExpiry": 2147483647,
"maximumNumberOfUsers": 100,
"unlimitedNumberOfUsers": false,
"serverId": "<My server ID>",
"supportEntitlementNumber": "SEN-500",
"license": "<My license number>",
"status": {
"currentNumberOfUsers": 13,
"serverId": "<My server ID>"
}