I am looking to get a hold of a LabelManager object in my Jira Listener code.
I don't see an obvious way to get a hold of this object
For my FieldAccessor I perform the following:
FieldAccessor fieldMgr = ComponentAccessor.getFieldAccessor();
How do I get a LabelManager in 4.4?
Cant you get one using pico container by adding a LabelManager in constructur parameters ?
Have you a code snippet of how I might achieve this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
private LabelManager labelManager;
// the constructor of your listener
public YourListener(final LabelManager labelManager) {
this.labelManager = labelManager;
}
Provided your class is managed by pico container. https://developer.atlassian.com/display/JIRADEV/PicoContainer+and+JIRA
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If your object where you want to use thevlabel manager is not instantiated by pico you can get it using this snippet
LabelManager labelManager = ComponentManager.getComponentInstanceOfType(LabelManager.class);
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.