I have 2 fields( select list single choice ) named A and B .A and B contains so many values as well .My request is if A field is selected with a value XM then the field B should shows only some selected values ( not all values ).How can I acheive this ?
Hi @Aswathi D
You can do it by creating a Behaviour that is part of Scriptrunner app.
https://scriptrunner.adaptavist.com/6.20.0/jira/behaviours-overview.html
Regards
Hi @Florian Bonniec ,
Is it possible to show an example behaviour for this case ?
Hi @Aswathi D please find below an example.
import com.atlassian.jira.component.ComponentAccessorimport com.onresolve.jira.groovy.user.FieldBehavioursimport groovy.transform.BaseScript@BaseScript FieldBehaviours fieldBehavioursfinal singleSelectListName = 'Select List'def radioButton = getFieldById(getFieldChanged())def allowedValuesif(radioButton.getValue() == 'A'){ allowedValues = ['1', '2']}if(radioButton.getValue() == 'B'){ allowedValues = ['3']}if(allowedValues){ // Getting select field options def selectCustomField = customFieldManager.customFieldObjects.findByName(singleSelectListName) def selectConfig = selectCustomField.getRelevantConfig(issueContext) def selectOptions = ComponentAccessor.optionsManager.getOptions(selectConfig) // Filter select available options final selectAvailableOptions = selectOptions.findAll { it.value in allowedValues } getFieldByName(singleSelectListName).setFieldOptions(selectAvailableOptions)}
Hello,
I have a more or less similar request.
I need to restrict the displayed values of a field. However, there is a difference. I don't have another defining field. Instead, I need to restrict the field values to "A" and "B" only on a transition screen.
Unfortunatelly I don't have scripting skills. Can someone please help with this?
Big thanks in advance!
Best regards,André
It looks like you're new here. Sign in or register to get started.