How to access host application license details during add-on license check

The License Validation Rules suggest various error messages an add-on should create if it encounters a license validation error. Composing those messages would require the add-on to access some detail information from the host application license:

  • LICENSE_TYPE - on type mismatch error
  • LIMIT - on max user (or max remote agent for Bamboo) mismatch

I have not found any API entry point to access this information programmatically from within an add-on - am I missing something or is this information simply not exposed by the host applications?

NOTE: This is basically a host application agnostic variation of How to programmatically access Confluence license details? (so far unanswered). We develop add-ons for various Atlassian applications and would like to handle license validation as uniform as possible.

2 answers

This widget could not be displayed.

It is available from com.atlassian.upm.license.storage.lib.ThirdPartyPluginLicenseStorageManager

(injectable as property or within a constructor param)

https://developer.atlassian.com/static/javadoc/upm/plugin-license-storage-lib/2.1/reference/com/atlassian/upm/license/storage/lib/ThirdPartyPluginLicenseStorageManager.html

 

Hm, as far as I can see, this would give me access to the PluginLicense (similar to com.atlassian.upm.api.license.PluginLicenseManager we use so far), but not to the *host application* license details the question is aiming at!?

Yes, sorry, missed another class in my answer: LicenseService, (com.atlassian.confluence.license.LicenseService, see https://docs.atlassian.com/confluence/latest/com/atlassian/confluence/license/LicenseService.html) ConfluenceLicense confluenceLicense = licenseService.retrieve(); get's you the confluence license object

This widget could not be displayed.

This might help you or someone else in the future

License confluenceLicense = LicenseManager.getInstance().getLicense(ConfluenceBootstrapConstants.DEFAULT_LICENSE_REGISTRY_KEY);
if (confluenceLicense != null) {
    LicenseType licenseType = confluenceLicense.getLicenseType();
....

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Aug 06, 2018 in Jira Service Desk

A is for Activate: Share your top Jira Service Desk onboarding tips for new users!

Hi, everyone! Molly here from the Jira Service Desk Product Marketing Team :).  In the spirit of this month's  august-challenge, we're sourcing stories of Jira Service Desk activation fro...

536 views 23 15
Join discussion

Atlassian User Groups

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!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you