Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to use LabelService add Label during Create Issue?

Ma Hao
Contributor
January 21, 2014

Hi,

I found that i have to create issue first,

then use the new issueid to validateAddLabel(User, issueId, label) and LabelService.addLabel(User, Result, false).

How can i add a issue with labels?

Not Create Issue before add label into it?

2 answers

1 accepted

1 vote
Answer accepted
Henning Tietgens
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.
January 21, 2014

You can use

def labelManager = ComponentManager.getComponentInstanceOfType(LabelManager.class)
labelManager.addLabel(currentUser, issue.id, 'username', false)

to add labels without notification.

Ma Hao
Contributor
January 22, 2014

Yeah, It will disable the sending of notification

But i can see the Issue Updated event still was triggered, how can i disable that?

Henning Tietgens
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.
January 22, 2014

I think you have to add the labels to the transientVars before the issue is created. But I don't know how.

0 votes
Ma Hao
Contributor
January 21, 2014

How to disable the Event_dispatch when adding label?

Suggest an answer

Log in or Sign up to answer