Behaviour's hideTab(FieldScreenTab tabToHide) will hide next tab on the right if tabToHide is already hid natively by Jira because tabToHide doesn't contain any field.
This could happen when fields in the tabToHide are not available for certain issue type in same screen.
1. Configure 2 additional tabs on a certain screen, for total of 3 (tab1, tab2 and tab3).
Note: tab3 must be on the right of tab2.
2. Put some fields into tab3.
3. Set a behaviour to hide tab2 with hideTab(FieldScreenTab tab). In initialiser:
This behaviour doesn't do anything because tab2 is already hid natively by Jira as tab2 has no field configured under.
tab3 is hidden.
Use hideTab("tabName") instead.
hideTab(tab2) use tab2.position to determine which tab to hide.
1. On screen configuration, tab2.position is 1 and tab3.position is 2.
2. When screen is opened, tab2 contains no field and is hid natively. Now, tab3.position becomes 1.
3. Therefore, hideTab(tab2) will now hide tab3.
With explanation above, hideTab(tab3) will also fails when tab2 is already hid natively by Jira. All these behaviours are illustrated in following screen recording.