Hi.
I try to read data from idalko table grid plugin customfield.
PluginAccessor pluginAccessor = ComponentAccessor.getPluginAccessor();
Class dataManagerClass = pluginAccessor.getClassLoader().loadClass("com.idalko.jira.plugins.igrid.api.data.TGEGridTableDataManager");
Object tgeGridDataManager = ComponentAccessor.getOSGiComponentInstanceOfType(dataManagerClass);
tgeGridDataManager.readGridData(...)
But IDEA can't resolve tgeGridDataManager methods.
How to properly load this class in project?
IDE won't be able to resolve this class, as you don't have it in your dependency and you are loading it at Runtime.
For IDE it is only possible if you have package containing class
com.idalko.jira.plugins.igrid.api.data.TGEGridTableDataManager
as maven dependency in your POM file.
Thank you. It's works.
1. step install jar to maven
C:\Applications\Atlassian\atlassian-plugin-sdk-6.3.10\apache-maven-3.2.1\bin>atlas-mvn install:install-file -DgroupId=com.idalko.jira.plugin -DartifactId=igrid -Dversion=1.29.5 -Dpackaging=jar -Dfile=C:\Applications\SituationReport\lib\idalko-igrid-1.29.5.jar
2. step add depedency to pom
<dependency>
<groupId>com.idalko.jira.plugin</groupId>
<artifactId>igrid</artifactId>
<version>1.29.5</version>
<scope>compile</scope>
</dependency>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But i have another question.
This classes provides interfaces but i don't understand how to use it.
TGEGridTableDataManager tgeGridDataManager = ComponentAccessor.getOSGiComponentInstanceOfType(com.idalko.jira.plugins.igrid.api.data.TGEGridTableDataManager.class);
Causes
Causes Caused by: java.lang.ClassCastException: Cannot cast com.idalko.jira.plugins.igrid.impl.data.TGEGridTableDataManagerImpl to com.idalko.jira.plugins.igrid.api.data.TGEGridTableDataManager
How to use this interface?
Thanks for advice.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I guess dependency scope should be `provided` and not `compile`.
If this doesn't work, try explicitly importing it in `maven-jira-plugin` configuration.
<Import-Package>
*;version="0";resolution:=optional
</Import-Package>
OR
<Import-Package>
com.idalko.jira.plugins.igrid.api.*;resolution:=optional,
*;version="0";resolution:=optional
</Import-Package>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.