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

...

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 Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,088 views 13 18
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot