Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Script runner Behavior displays disabled values Edited

We have few behaviors, where based on field A, field B values will be shown. but in field B we have 40 options, out of which 5 dropdown options are disabled. Now, behavior should only show 35 options in field b, instead we see all 40 which includes disabled values.

How can we not show disabled values?


Any input is appreciated.

1 answer

Hi @KRC it depends on the implementation of your behaviours script. Can you share it? In my opinion the values are put to the list of values of the field incorrectly.

def customField = customFieldManager.getCustomFieldObject(fieldBizName.getFieldId()) 
def config = customField.getRelevantConfig(getIssueContext())
def options = optionsManager.getOptions(config).findAll{!it.disabled}

In order to set options, i have added  findAll{!it.disabled} at the end, is this a proper approach?

@Martin Bayer _MoroSystems_ s_r_o__  thank you for taking time to respond.

Hi @KRC it looks fine, can you debug it a little? I would print options to check the condition it.disabled works...

Suggest an answer

Log in or Sign up to answer

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you