Jira script/listener/behavior - how to control hiding/unhiding a custom field having a value? For e.g. sometimes, I want to hide it even if it has a value in it and sometimes I want to show the field based on some condition.
Example: Say I have two single select fields - Field1 having options as O1, O2. If I select O1, then the other field Field2 should appear. Field2 is also a single select field having options as Op1, Op2, Op3. Lets say I select Op2.
Now if I change Field1 to O2, Field2 should disappear from the edit and view screen. '
I tried using Behavior. But the problem I am facing - because Field2 has a value in it, on View screen, the field appears.
What I want is - retain the value of Field2 and still hide it.
Said that, I dont want to remove Field2 permanently from View screen because I want to see it (with its old value) when option O1 is selected on Field1.
So may be if there is some script that I can use that will allow me to control adding/removing a field from a screen, it may work.
Appreciate any solution.
N.B. - i have a workaround but would like to know if there is any direct solution to this.
Workaround:- create a new field (Field2-backup) and dont add that to any screen. Then use it to store the old value of Field2 and then remove the value from Field2. Now Field2 will not appear on View screen as iot does not have a value. And in future when O1 is selected, pull the value from Field2-backup and populate it in Field2.