How to remove values from multiselect checkbox?


I want to write a script post function on sub-task transition to "Done" in order to delete values in a custom field of type multiselect checkbox on its parent.


Can you please advise how to remove values from multiselect checkbox custom field?


2 answers

1 accepted

0 votes
Answer accepted


This should help you set the checkbox field to the new values:

You can provide a list of options when you call issue.setCustomFieldValue()

Hi Alina,

do you mean that i need to set a list of existing values but the one i want to remove?

What kind of list do i need to create? list of option id's?

Is there a way to remove a single value from being checked?



Hi, Paz

You can get the list of currently checked values with:


This gives you a list of Option objects.

You can iterate through this list, check the value using the getValue() method and remove the option from the list if you don't want to keep it.

Then you can set the custom field value to the new list.

Check the examples I gave you and I think it will be clearer. They were useful to me for a similar task.


Hi Alina,

Thanks much!

I think my script got better but it still doesn't work and there are no errors, can you please advise?

import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.config.FieldConfig
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.customfields.manager.OptionsManager
import com.atlassian.jira.issue.customfields.option.Option

MutableIssue issue = ComponentAccessor.getIssueManager().getIssueObject("PP-10")
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();
def involvedField = customFieldManager.getCustomFieldObjectByName('Involved teams')
def involvedValue = issue.getCustomFieldValue(involvedField)
ArrayList<Option> myList =(ArrayList<Option>) involvedValue
ArrayList<Option> values = new ArrayList<Option>();
for(Option option : myList){
     if(option.getValue() != "B"){

I just had to add

Thanks much Alina smile


Sorry I couldn't get back to you, I was out of office for a few days with limited Internet access.

Great to hear you got it working! You are very welcome smile

Is there a way to do this without code?

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted yesterday in United States

Confluence Security Advisory

Good morning Members, Not sure if you are aware. Please read the following: More details: https://co...

43 views 1 0
View post

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