I have stories that are linked to Epics using Epic Link field. This makes the Epic the parent issue of the Story.
There are two field for the Epic issue type:
- Program Eligibility (Yes/No drop down field)
- Program Name (single select field)
I need help creating a groovy script for the workflow validator that does the following for:
When moving the Story to the closed status, a groovy script validator should check the following:
- See if the story has an Epic linked
- If the story has an Epic then check to see if the Program Eligibility field is set to Yes or No
- If the Program Eligibility field is set to Yes, then ensure that the Program Name is not null.
- If the story has no linked Epic - the story can be closed without any restriction
- If the story has an epic linked - the field Program Eligibility is set to No - the story can be closed without any restriction
- If the story has an epic linked - the field Program Eligibility is set to Yes - the field Program Name is not null and has a value selected - the story can be closed without restriction
- If the story has an epic linked - the field Program Eligibility on the Epic is set to Yes - the field Program Name on the Epic is null - the story cannot be closed and display an error that the Linked Epic field has a null Program Name since the Program Eligibility is Yes, the Program name must be selected for the Epic.