How to delete a label from an issue?

I am trying to add functionality in my plugin to remove a label from an issue.

Any help?

5 answers

1 accepted

This widget could not be displayed.

Create a new Set<String> that contains all but one label, that is the one to be deleted.

Call LabelManager.setLabel().

or use MutableIssue to use mutableIssue.setLabels(Set<Label>)

(i don't prefer this one)

This widget could not be displayed.

which version of Jira you are using?

This widget could not be displayed.

currently m workin on 4.1 but planning to shift to 4.4 soon

This widget could not be displayed.

currently m workin on jira 4.4.1

This widget could not be displayed.

following way you can delete labels from issue

issue.getLabels();

it will return set of lables which are appended to issue from that set you can delete label if ur deleting one label you have to update remaining set using

issue.setLabels(setof labels);

if you are deleteing all labels then you have to set labels with empty set

let me know if have any question

cheers


i cudnt find any issue.setLabes() method....however i gt came across LabelManager.setLabels()...however it takes Set<String> of label so i need to convert all labels i want to add to string

if you are using jira 4.4.1 then you should get that methods, you can find the API at

http://docs.atlassian.com/jira/4.4.1/com/atlassian/jira/issue/Issue.html

still if you have questions let me know

sory fr d discontinuity...but dere were sm priority tasks at hand...

as i said.... i have d getLabels() method....but not setLabels(set)

rather i cudnt find any setter for Issue

Normally For Issue Object don't have any methods to set values. you have to use Mutable Issue to set values,

you can find that method at http://docs.atlassian.com/jira/4.4.1/com/atlassian/jira/issue/MutableIssue.html#setLabels(java.util.Set)

still if you have question let me know

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

524 views 3 19
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you