Details
-
Bug
-
Status: Done
-
Major
-
Resolution: Duplicate
-
6.58.0
-
None
-
None
-
0
Description
When using the Behaviour to validate the Parent and Child values from the Cascading Select Field, the Child values are not detected. This was working fine until version 6.57.0
Steps to Reproduce
- Add a new Behaviour configuration with two Server-Side Behaviours. The first for a Cascading Select Field and the second for a Text Field
- For the Cascading Select Field, below is the sample code used:-
import com.onresolve.jira.groovy.user.FieldBehaviours import groovy.transform.BaseScript @BaseScript FieldBehaviours behaviours def cascadeField = getFieldById(fieldChanged) def cascadeFieldValue = cascadeField.value as List def sampleText = getFieldByName('Sample Text Field') cascadeField.clearError() if(cascadeFieldValue) { if(cascadeFieldValue.size() == 2) { log.warn "====>>>>${cascadeFieldValue.first()} ${cascadeFieldValue.last()}" sampleText.setFormValue(cascadeFieldValue.last().toString()) sampleText.hidden = false } else { cascadeField.error = "Child value cannot be null" } }
Also, a field error message is included for the Cascading Select List to ensure that both parent and child options are selected.
Below is a screenshot of the Server-Side Behaviour configuration for the Cascading Select List:-
- And for the Text Field, just use the toggle to update the Shown option to Hidden as shown below:-
- Try to create a new issue and select an option from both the parent and child of the Cascading Select List.
Expected Behaviour
The text field is made visible and is updated with the option selected from the child list of Cascading Select List.
Actual Behaviour
The Behaviour doesn't get triggered. Even if the Child option is selected from the Cascading Select List, the error message does not get removed.
Additional Info
- A test video, i.e. test1.mp4
, that displays the test run on ScriptRunner version 6.57.0 and 6.58.0, is included to show the difference in the Behaviour.
Attachments
Issue Links
- is related to
-
SRJIRA-6113 Behaviour not able to read child value for cascading select list since SR 6.58.0
-
- Done
-