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

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 vote
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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Sunday in Agility

You asked for it, so we delivered: images on issues have arrived

A picture tells a thousand words. And agility boards have just released their latest feature: cover images on issues – so now your board can tell a story at first glance. Upload attachmen...

136 views 1 10
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