Script runner Behavior displays disabled values

KRC July 12, 2021

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

0 votes
Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 12, 2021

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.

KRC July 14, 2021
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.

Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 14, 2021

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