I’m trying to access JSD from a workflow post function I’m currently implementing. Goal is to modify the issue’s SLA info based on data that has been provided in the WF transition.
My problem is that i do not know how to get an “entry” to the JSD classes…
In my post-function class I have a @ComponentImport ServiceDeskManager sdManager;
which I would like to use for a serviceDesk = sdManager.getServiceDeskForProject (issue.getProjectObject());
The code compiles fine. However when the post function is getting called, myserviceDeskManager variable turns out to be null!
What am I missing? Anyone can tell me how to create a valid JSD manager class?
Did you annotate the class with the appropriate annotation? Something like @Scanned? Then on the constructor you’ll need the @Inject annotation as well.
Thanks for that hint! Of course i already had annotated the class with @Scanned, however i did not specify a constructor! My class is extending AbstractJiraFunctionProvider, just implementing the execute(…) method and I was using the super constructor. After adding my own constructor with @ComponentImport parameter, I finally have my ServiceDeskManager class available!
However when now trying to call Either<AnError,ServiceDesk> serviceDesk = sdManager.getServiceDeskForProject (issue.getProjectObject());
and even when using Object = sdManager.getServiceDeskForProject (issue.getProjectObject());
i get the following exception:
[INFO] [talledLocalContainer] java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) previously initiated loading for a different type with name "com/atlassian/fugue/Either" [INFO] [talledLocalContainer] at java.lang.ClassLoader.defineClass1(Native Method) [INFO] [talledLocalContainer] at java.lang.ClassLoader.defineClass(ClassLoader.java:763) [INFO] [talledLocalContainer] at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2279) ...
Have you marked the com.atlassian.fugue dependency as compile in your plugin? It should be provided and OSGI imported (Import-Package), so that JIRA can give it to you.