Is there an easy way to access Jira Configuration Properties from my plugins like the '<tt>jira.projectkey.pattern' property?
</tt>
Community moderators have prevented the ability to post new answers.
Well after testing this one, the following works (I am using Dependency injection to get an instance of ApplicationProperties)
this.applicationProperties.asMap().get("jira.projectkey.pattern") that will return what I am looking for.
Though I tried
this.applicationProperties.getString("jira.projectkey.pattern") and got a null. go figure.
I was also unable to get what I wanted from the PropertiesManager.
Use PropertySet to do it.
PropertySet propertySet = PropertiesManager.getInstance().getPropertySet();
String value = propertySet.getString(PROPRTY_KEY);
Also checkout http://confluence.atlassian.com/display/JIRA/Configuration+properties
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's good to know. Thanks Jason
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
FYI, PropertiesManager.getInstance is deprecated
The JavaDoc recommends either to use Dependancy Injection or ComponentManager.getComponent(PropertiesManager.class)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well looks like I asked too soon,
You can get ApplicationProperties from the ComponetManager.
ComponentManager.getInstance().getApplicationProperties().getString("jira.projectkey.pattern");
This looks like it will work
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
oh yes, for the properties in jira application properties, use ApplicationProperties.
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.