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.
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.
Earning the Mindful Member badge proves you know how to lead with kindness, plus it enters you into a giveaway for exclusive Atlassian swag. Take the quiz, grab the badge, and comment on our announcement article to spread the good vibes!
Start here
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.