Hello Team,
I am using the Simple Scripted Validator (Scriptrunner) for the Jira workflow as below :-
issue.getCustomFieldValue(customFieldManager.getCustomFieldObject("customfield_19742")) && isUserMemberOfRole('Product Managers')
||(issue.getCustomFieldValue(customFieldManager.getCustomFieldObject("customfield_19742")) == "Testing Only" && isUserMemberOfRole('Test Leads’))
||(issue.getCustomFieldValue(customFieldManager.getCustomFieldObject("customfield_19742")) == "Documentation Only" && isUserMemberOfRole('Documentation Authors’))
||(issue.getCustomFieldValue(customFieldManager.getCustomFieldObject("customfield_19742")) == "Research" && isUserMemberOfRole('Development Leads’))
||(issue.getCustomFieldValue(customFieldManager.getCustomFieldObject("customfield_19742")) == "Engineering Infrastructure" && isUserMemberOfRole('DevOps Leads’))
This script is trying to ensure that if the custom field of type Select list (single choice) satisfies either of the conditions then only validator allows to proceed, but we have noticed that only 1st part is being validated, and if the first condition fails and second one is true it is not processing.
I also tried an alternative script for testing as below :-
cfValues['Feature Type']?.value == 'Testing Only' && isUserMemberOfRole("Test Leads")
|| cfValues['Feature Type']?.value == 'Documentation Only' && isUserMemberOfRole("Documentation Leads")
In this case also it is not checking the second condition if first one fails.
Please help to identify the cause of why the OR logic is not working for me. Am i missing something.
Thanks and Regards,
Sreedevi