Rather then creating custom field via module you can create event listener for you Custom Field Type PluginModule or whole Plugin and create field when you receive that event.
You can find Java doc for plugins related event in this.
https://docs.atlassian.com/DAC/javadoc/plugins/2.5/reference/packages.html
Thanks for the suggestion. Unfortunately, the custom field type is still not available even after the 'module enabled' event is emitted. As you can see in the logs, the custom-field-type class gets instantiated after the module is enabled. So first 1) plugin is enabled and then 2) module is enabled only then 3) the custom field gets created (which oddly gets triggered by visiting the custom field page in the browser).
2019-08-04 11:48:32,353 QuickReload - Plugin Installer INFO [atlassian.plugin.manager.PluginEnabler] Plugin 'hk.com.epictechnology.plugins.wsjf-plugin' is now ENABLED
2019-08-04 11:48:32,356 QuickReload - Plugin Installer INFO [com.epictechnology.plugins.IssueCreatedResolvedListener] Module enabled with this key: wsjf-custom-field
2019-08-04 11:50:05,472 http-nio-2990-exec-4 INFO admin 710x11818x1 g6fxpq 0:0:0:0:0:0:0:1 /secure/admin/ViewCustomFields.jspa [com.epictechnology.plugins.WsjfCustomField] WsjfCustomField class instantiated (logged by constructor).
I am so baffled... Is there some other event I can listen to? I tried PluginModuleAvailableEvent, but that doesn't get emitted at all.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried
public void afterPropertiesSet() throws Exception
In you plugin life cycle listener class.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That worked! I ended up having to use an async event because the custom-field-type module had an issue with reentrancy. Thanks for your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.