Need help with Groovy Script Validator

Vinay Vira April 10, 2018

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. 

1 answer

1 vote
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 10, 2018

I think you should try to write the script yourself and then ask for help, if something does not work.

Vinay Vira April 10, 2018

I don't have any experience writing groovy scripts or any type of programing code and couldn't find any resources that could help me even get started. Please provide any resource you many have on groovy scripts 101. I would be more than happy to test out myself.

Thanks

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 10, 2018
Vinay Vira April 12, 2018

Thank you! 

I will test it out and post on here once I have something.

Suggest an answer

Log in or Sign up to answer