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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.