Hi All,
In my old JIRA custom plugin code I was using the below code snippet
DefaultJiraHome djhome = new DefaultJiraHome(); File pluginsRoot = djhome.getPluginsDirectory(); String confFilePath = pluginsRoot.getPath();
after upgrading the APIs to 5.0 DefaultJiraHome seems missing.Which class has the implemenation of JiraHome interface so that I can rewrite the code to get the plugin root path.
Any help on this is appreciated.
Regards
Community moderators have prevented the ability to post new answers.
Use
JiraHome home =
ComponentAccessor.getComponentOfType(JiraHome.class)
You can use Option object here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
perfect this works great.
Also I am trying to get a values from a dropdown custom field.Earlier I used to do this way
Object lLoption = (Object) issue.getCustomFieldValue(RCcustomField); if(lLoption !=null){ lLoption = (LazyLoadedOption)lLoption; } String fileTypeVal=null; if(lLoption != null){ fileTypeVal= (String) ((LazyLoadedOption) lLoption).getValue(); }
But Now the Lazyloaded option class is not found.Could you please help me with that too.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The class is still there. Since Jira 5 the implementation classes are partially hidden in a dedicated jar and to enforce programming against interfaces, Atlassian has removed this jar from the pom.xml. But you can include this in your project by enabling the following dependency in pom.xml
<dependency> <groupId>com.atlassian.jira</groupId> <artifactId>jira-core</artifactId> <version>${jira.version}</version> <scope>provided</scope> </dependency>
If you use eclipse you have to run atlas-mvn eclipse:eclipse to add the jira-core jar to your classpath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.