Behaviors: how to make checkbox custom field options hide/visible depending on selected checkboxes inside of the field.

Hi, Folks!
You know, I'm trying to make some checkboxes hidden when I select specific checkboxes of the field.
For example, I have:
"Custom Field" - checkbox type
"A","B","C","D" - the values of this field.
IF I select values "A"&"B" so that values "C" & "D" should be hidden.
How can I solve it is?
Please help me.
Many thanks for advice.

1 answer

1 accepted

1 vote

This isn't really possible through behaviours, its only possible to hide the complete field not specific checkboxes within it. 

Although as a workaround you could use two separate checkboxes and have this script on the checkbox field which contains "A" and "B" and "C" and "D" are on a completely different field. It sounds like they are kind of independent anyway.

import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript

@BaseScript FieldBehaviours fieldBehaviours

// this field contains boxes A and B
def checkboxField = getFieldById(getFieldChanged())

// This contains boxes C and D
def otherCheckboxField = getFieldByName("Other Checkbox")

def values = checkboxField.getValue() as List<String>

if (values.containsAll(["A", "B"])) {
    // hide field containing C and D when A and B selected

Hi @Adam Markham [Adaptavist], just wanted to clarify:


Is it not possible to hide checkbox field options at all, or only in the use case presented in the question?


I can use the script below to hide options on a Select field using the Behaviours initializer, but it doesn't work when applied to a checkbox field. I thought they were controlled by same Options classes? Please excuse me if I'm using incorrect nomenclature.

def formField = getFieldByName("Some field");
def customField = customFieldManager.getCustomFieldObject(formField.getFieldId());
def config = customField.getRelevantConfig(getIssueContext());
def options = optionsManager.getOptions(config);

def optionsMap = options.findAll {
    it.value in ["Some option"] 
}.collectEntries {
        (it.optionId.toString()) : it.value




Do we know if Adaptavist has thise feature in future roadmap to hide options on checkboxes using behaviors ?

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Published Apr 19, 2018 in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

366 views 0 6
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