You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Join now to unlock these features and more
I'm working in a new issue type which has two fields (input required). In this context, I'll call them field A and field B.
Both fields were created using ScriptRunner plugin and both of them are Database pickers.
Field B will run an SQL query using the value which was provided in field A and to avoid unwanted results, I've created a behaviour.
This behaviour will make field B as a read-only field in the Initialiser script, since the value for field B should only be selected after field A value is picked.
Also, I've added a script for field A which will clear the value for field B and make it editable if the value for field A value is different than null. If the field A value is equal to null, this script will also clear the field B and make it read-only.
This is working as expected in the Create issue action, however I've found an unexpected result while trying to Edit the issue.
When the Edit dialog shows up, the field A has the previously selected value but field B is null.
I suppose this happens due to the fact that once the Edit dialog appears the field A is mapped with the value given earlier and the behaviour is triggered because the plugin detects that the field A value was changed.
Is there a way to make the behaviour trigger only when the field is clicked on and make it so the behaviour is not triggered when the Edit dialog shows up?
For reference, I'm sharing the script for field A below: