Validation that the executionStatus of all test cases (of the linked issues) are "Pass" or "Blocked"

Hi,

How to add Scripted (Groovy) Validator that will check that the executionStatus of all test cases (of the linked issues) are “Pass” or “Blocked”. This will require iterating over the related test cases and for each one, calling the Zephyr REST API to check the status of its test cases:

issue.getLinkedIssues(“Related Test Cases-o”).every{ testIssue =>
//here goes the code that calls the Zephyr REST API to get the test results for the testIssue.key issue key and checks the status of these tests
}

What is the correct script and the correct code of the Zephyr REST API to be used?

Thanks