The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Script runner Behavior displays disabled values

KRC
Contributor
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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Martin Bayer _MoroSystems_ s_r_o__
Community Champion
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
Contributor
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 Champion
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...