I have a date and time field that is blank by default but I would like the field to be mandatory at ticket creation if a certain option is selected in a different custom field.
Scenario:
Option 1
If Option A of Field A (dropdown list single choice) is selected, Field B (date & time field) is not mandatory and the ticket can be created.
Option 2
If Option B or C of Field A (dropdown list single choice) is selected, Field B (date & time field) is mandatory and the ticket cannot be created.
I have tried to use a "Simple Scripted Validator" from Scriptrunner without success.
My last code attempt were:
(cfValues['Field A'] == 'Option B' && cfValues['Field B'] != null)
(cfValues['Field A'] == 'Option B' && cfValues['Field B'] == null)
(cfValues['Field A'] == 'Option B' || cfValues['Field B'] != null)
(cfValues['Field A'] == 'Option B' || cfValues['Field B'] == null)
All of them failed either by allowing the creation when it should be blocked or by blocking the creation when it should be allowed.
Can anyone help with this code?
Thank you