I am using Behaviours to conditionally hide/show one custom field out of four (A,B,C,D), based on the value of another (single selection) custom field (X).
When the value of X is "AA", I want to show field A and hide B,C,D. When value is "BB", I want to show B and hide A,C,D, and so on.
I am basing my code on the example given here (https://scriptrunner.adaptavist.com/5.3.16/jira/recipes/behaviours/select-list-other.html)
but what is missing from the documentation is how to set up the dependent field ("Favourite Fruit (Other),") in the relevant screen(s). In my case, if I set the field A to be shown, then it always appears on my create screen. If I set it to Hidden, it never shows. Inspecting the page does not show the field at all in the latter case.
I have another Jira server with an older version of Behaviours (when it was a separate add-on) and when I inspect the page there, the dependent field A is always on the page. When it's shown, the <div> element that wraps the field is this:
<div class="field-group" style="display:block;">
When the field is hidden by Behaviours, the div is:
<div class="field-group" style="display:none;">
Please advise.