Remove label with Automation

Justin Warwick October 19, 2018

I see that on issue creation I can create an automation action of type "Edit issue" to *apply* labels, but I would also like to be able to *remove* labels. Is there a way to do that?

I would greatly prefer a method that does not require plugins, but if plugins are the only way, which ever is the most stable, least upgrade-affecting plugin would be preferred.

 

1 answer

1 accepted

2 votes
Answer accepted
Deleted user October 21, 2018

Hello @Justin Warwick,

 

No need of other add-on's. To remove the labels, you just need to leave the value field as empty and save the changes. See screenshot below : 

label edit.png

Thanks,

Swathi

Justin Warwick October 22, 2018

Thank you, Swathi, that worked for my current situation (where we just wanted to remove the issue collector label on the way in). As a further clarification, though: there is no way to remove specific labels, leaving others in place. Our only choice, by this method, is to remove all labels all at once. Is that correct?

Deleted user October 22, 2018

Hi @Justin Warwick,

 

Yes, that's correct... unfortunately ;)

 

I know another way to implement this using add-on. Just in case if you are interested, you can try this.

Use script runner post function (custom script) in workflow transition. See the script below : 

 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.label.LabelManager

def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
LabelManager labelManager = ComponentAccessor.getComponent(LabelManager) def labels = labelManager.getLabels(issue.id).collect{it.getLabel()} labels -= 'labelToBeRemoved' labelManager.setLabels(user,issue.id,labels.toSet(),false,false)

 

Regards,

Swathi

Like # people like this
Justin Warwick October 23, 2018

Excellent, thank you, Swathi. This makes for a very complete answer and is very helpful. Cheers!

Suggest an answer

Log in or Sign up to answer