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 Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Apr 17, 2018 in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

770 views 2 19
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