How to create custom filed on start of plugin

It’s possible that you are attempting to access components too early in the add-on lifecycle. Under Plugin system events, in the JIRA Plugins2 overview, there’s this:

“Due to the shortcomings of the component initialisation stage, a listener on the PluginEnabledEvent is the earliest time that you should attempt to do any serious wiring into JIRA. For example, if your plugin needs to ensure there are particular custom fields created in JIRA for the plugin to function properly, the plugin should attempt to create them during this stage, and not earlier.”

So it would be worth trying your custom field creation work in response to the PluginEnabledEvent, rather than in the afterPropertiesSet() method. If you do try that, please let us know if it works for you.

2 Likes