Disable Custom Fields when plugin license has expired

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
Accepted answer

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
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

Thank you Tuncay, I will try that.

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
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,721 views 17 21
Read article

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