Dependency issues with Insight, required class missing

Hi Jira Community,

I’ve seen there’s a tutorial for creating own Field types e.g., to limit access based on user groups.

https://developer.atlassian.com/server/jira/platform/creating-a-custom-field-type/

I’ve already successfully done if for other field types and I wanted to do a custom Insight field that I’m extending from:

com.riadalabs.jira.plugins.insight.services.jira.customfield.DefaultObjectCustomField

I’ve the following insight dependencies:

<dependency>
    <groupId>com.riadalabs.jira.plugins</groupId>
    <artifactId>insight</artifactId>
    <version>9.0.7</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>com.atlassian.jira.plugins</groupId>
    <artifactId>insight-cve-integration</artifactId>
    <version>1.3.9</version>
</dependency>

I thought DefaultObjectCustomField should be included in com.riadalabs.jira.plugins but when I try to install it I get:

[c.t.common.MypluginOnStartupListener] Disabling plugin
2022-10-20 15:07:43,100+0000 UpmAsynchronousTaskManager:thread-3 INFO myusername 999x14314x4 1u6i88e 80.146.191.211,100.125.67.227 /rest/plugins/1.0/available/featured [c.a.plugin.manager.DefaultPluginManager] Updating plugin 'com.mycompany.myplugin:1.0.4 A required class was missing: adminonlyinsightfield.name. Please check that you have all of the required dependencies.<br/>com/riadalabs/jira/plugins/insight/services/jira/customfield/DefaultObjectCustomField' from version '1.0.4' to version '1.0.4'

I’m a bit confused what causes it, since I’ve successfully worked with the Insight Plugin before. Has anyone maybe an idea what could cause that behavior?

Hi @CarolineW,

I think the issue that you are seeing is because the dependency on Insight is provided and the class which you are trying to extend DefaultObjectCustomField is not in an exported public API package. As the class is not included in the public APIs or exported by OSGI, extending it isn’t something that is supported at this point.

If you were to set the dependency as compile scope, your plugin would then bundle the jar which should resolve the issue that you see, but you may run into other issues if it is not the same version which is deployed. Since you are just using it to create a custom field and then presumably exporting your own custom field to Jira and not for the exported services, it may be ok.

As an aside, I would also suggest upgrading to a newer version of Insight, now Assets. The last release of the 9.x branch was 9.1.12. The version you have in your POM is from around April 2021 and since then there has been a lot of bug and performance fixes on Insight/Assets.

Hope this helps.

Thanks,
Craig
JSM DC

1 Like

Thank you for your answer. I know that Insight is now in Assets and I proabably should update, but to be honest I’m pretty confused what the corresponding Maven libary that replaces com.riadalabs.jira.plugins.insight is. Can you give me a hint?