Cannot get class of JSM API

Hi!

I installed my add-on to JIRA Core.
Then installed JSM.

Got error:
java.lang.NoClassDefFoundError: com/atlassian/servicedesk/api/requesttype/RequestTypeService

If I reinstall the add-on it will work.

I want to work add-on without reinstalling it.

POM
I have dependency

<dependency>
            <groupId>com.atlassian.servicedesk</groupId>
            <artifactId>jira-servicedesk-api</artifactId>
            <version>4.13.0</version>
            <scope>provided</scope>
        </dependency>

And import-package

 <Import-Package>
                            com.atlassian.servicedesk.api.*;resolution:=optional,
                            org.springframework.osgi.*;resolution:="optional",
                            org.eclipse.gemini.blueprint.*;resolution:="optional", *;version="0";resolution:=optional,
                        </Import-Package>

Inside the class

        RequestTypeService requestTypeService = ComponentAccessor.getOSGiComponentInstanceOfType(RequestTypeService.class);

I tried @ComponentImport but in this case the add-on will not work without JSM

1 Like