Any way to remove a Label on Resolution?

I'm very familiar with adding Post Functions to alter an issue during a transition. The problem is that I can't seem to find a way to remove one particular label during transition to Resolution. I can clear the entire field, but that is not desirable.

I have also tried to create a Condition to prevent Resolution of an issue if the label is present, but this didn't appear to work either. A few comments by Atlassian employees imply that Conditions can't work with the system Labels field.

4 answers

1 accepted

10 votes
Accepted answer

You could use the Script Runner plugin and the following script for a start.

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

def user = ComponentAccessor.jiraAuthenticationContext.getLoggedInUser()

LabelManager labelManager = ComponentAccessor.getComponent(LabelManager)
def labels = labelManager.getLabels({it.getLabel()}
labels -= 'labelToBeRemoved'

The script is not tested by me, so be careful :-)


Is there any way to do this with the hosted version of Jira these days? We use a label of "merged" when branch code is merged into master and handed over to QA. but when QA re-opens the ticket, we wish to have that transition automatically remove said label if it exists (and of course, leave all the other labels !!!)

script is also helpful after 3 years wink worked perfectly after changing line 4 to:
def user = ComponentAccessor.getJiraAuthenticationContext().getUser()

For JIRA v7.x you need to change line 4 to:

def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()

Hi Ville-Pekka, 

that's exactly what's written in line 4. It's only another notation. In Groovy you could replace abc.getXyz() method calls with property access (remove get from the name, remove () and write the first letter in lower case). See

It could be written even shorter with 



Oops. Way too long day behind last night smile

I did not even tested original code, but modified it first according to Alexander's comment.

Anyway this code is working and in our production now.

Hi Henning,

how can i do this with a custom-field from type label?


Yes, I meant Labels. I've adjusted the question to indicate this. Thanks!

0 votes
Timothy Chin Community Champion May 22, 2013

Tags is Labels right?

0 votes
Timothy Chin Community Champion May 22, 2013

I think the best way for you is to use Script Runner's post function

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,230 views 5 10
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