Hi,
Was working on a plugin that does some basic stuff in both Jira & Confluence.
I need to get some application property and determine if the application the plugin is in Jira or Confluence.
I found that SAL has a class that can help me determine the application. So i am trying to get the instance for the class from SAL ComponentLocator method.
However the issue is that it works fine in Confluence and returns the ApplicationProperties instance but returns null for Jira.
Java code snippet.
import com.atlassian.sal.api.ApplicationProperties;
import com.atlassian.sal.api.component.ComponentLocator;
...
String getPlatform(){
ApplicationProperties applicationProperties = ComponentLocator.getComponent(ApplicationProperties.class);
System.out.println("Is AppProp Null? : " + applicationProperties==null);
if (applicationProperties != null) {
System.out.println("Current platform is : " + applicationProperties.getPlatformId());
}
...
}
...
Logs in Confluence :
Is AppProp Null? : false
Current platform is : conf
Logs in Jira:
Is AppProp Null? : true
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.