Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Which class has the implentation of com.atlassian.jira.config.util.JiraHome in JIRA 5.0 APIs

Sathish Venkat April 19, 2012

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

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 19, 2012

Use

JiraHome home = ComponentAccessor.getComponentOfType(JiraHome.class)

Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 19, 2012

You can use Option object here.

Sathish Venkat April 19, 2012

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

1 vote
Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 19, 2012

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

TAGS
AUG Leaders

Atlassian Community Events