Creating LabelManager object in Jira 4.4

David Joyce
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 15, 2011

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?

2 answers

1 accepted

1 vote
Answer accepted
Mikael Löwenadler
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.
November 16, 2011

Cant you get one using pico container by adding a LabelManager in constructur parameters ?

David Joyce
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 18, 2011

Have you a code snippet of how I might achieve this?

Mikael Löwenadler
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.
November 19, 2011

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

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.
November 19, 2011

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);

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events