Hi,
I have a project with multiple custom issue types
I have 2 custom fields
1. Priority ( select list ) (customfield_10043)
2. Reason for urgency (text field) (customfield_10044)
The above 2 fields are non mandatory and also not present for all issue types
I want to write a scriptrunner script validator on create transition which checks that if Priority ='Critical and urgent' then reason for urgency field should be mandatory.
I wrote something like this
issue.customfield_10043.value=="Critical and Urgent" && issue.customfield_10044.value != ""
the above script doesnt seem to work properly.
When i try to create an issue where these fields are not available, the validator still fires and doesnt allow issue creation
for issues that do have both these fields, validator throws an error if the leave Priority as None (None being auto injected by JIRA as this is not a required field)
I can find how to add a null checking condition in the validator . Also validator tells me that 'Script Validators ONLY use Jira Expressions'
Any help is deeply appreciated.
Thanks !