Disable Custom Fields when plugin license has expired

Bahar Çağlar November 1, 2012

When license is invalid, settings page will not be displayed great :)

https://answers.atlassian.com/questions/101536/thirdpartypluginlicensestoragemanager-example-code

However, plugin has custom field modules. When license has expired, the custom field is still on the custom field list, and the custom fields added before the expiration of the lisence are usable in related screens. How can I solve it? Any ideas?


2 answers

1 accepted

0 votes
Answer accepted
Bahar Çağlar November 4, 2012

First, you should test licensing using ThirdPartyPluginLicenseStorageManager, and if the license is not valid, You should pass empty velocity parameters to your view.vm. Otherwise, You should pass your velocity parameters.

Map<String, Object> velocityParams = new HashMap<String, Object>();
if(!hasLicense()){
 return velocityParams;
}
...

velocityParams.put("setvals", setValuesList);

...

0 votes
Tuncay Senturk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 1, 2012
Hi Bahar, I faced the same problem and asked to Atlassian developer relations. You may show error message in the custom field area rather than disabling custom fields. So that customer will know there is something wrong with plugin's license. So, you have to check license validity on your custom fields actions and show license error messages in the custom fields area Hope that helps Tuncay Senturk
Bahar Çağlar November 4, 2012

Thank you Tuncay, I will try that.

Bahar Çağlar November 4, 2012

First, you should test licensing using ThirdPartyPluginLicenseStorageManager, and if the license is not valid, You should pass empty velocity parameters. Otherwise, You should pass your velocity parameters.

Map<String, Object> velocityParams = new HashMap<String, Object>();
if(!hasLicense()){
 return velocityParams;
}
...

velocityParams.put("setvals", setValuesList);

...

Suggest an answer

Log in or Sign up to answer