Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I allow an to epic to transition to Done only if all child issue meet criteria

Ran Wronsky
Contributor
January 15, 2023

Hello,

I have build a workflow for epics in which I want to block transition to done in 2 cases:

1. Any story or task are open (not Done / invalid / not required)

AND

2. If child issue is a bug and status is open (not Done / invalid / not required), then priority should not be P0 or P1.

I'm unable to understand how to do that.

When attempting to do #1, using "Linked Issues Status Validator (JMWE app)" I don't understand the link type which defines child issue as none of the options listed under "Issue Link Type" seems to do the job. Only using "Any" link type seems to work but that also prevents the transition when there are related linked issues which do not meet the criteria.

Thanks for the help.

3 answers

3 accepted

1 vote
Answer accepted
David Fischer
Community Champion
January 16, 2023

Hi @Ran Wronsky 

this is what you want to validate both cases:

image.png

Of course you'll need to replace the selected statuses with Done / invalid / not required instead of Done / Cancelled / Rejected in the screenshot above.

The conditional execution script is:

issue.issueType.name != "Bug" || ["P0","P1"].includes(issue.priority.name)
Ran Wronsky
Contributor
January 17, 2023

Thank you David.

1 vote
Answer accepted
Ran Wronsky
Contributor
January 15, 2023

Thanks David.

I must be missing something as this did not work for me.

I was able to implement #1 using "Linked Issue status validator" for any link type and any issue type with the following conditional validation:

"issue.customfield_10018 == issue.epic.key" (which is my translation for epic link = parent link)

The custom field is "Epic Link". This is how I'm able to filter only the child issues.

But at this point, I'm unable to understand why the validation fails even when all child issues are done. for some reason I get the following error:

"Evaluation failed: "issue.epic.key" - Unrecognized property of `issue.epic`: "key" ('key')."

Even though when testing each of the child issues in the validation, I'm able to get the epic link and the validation is true.

David Fischer
Community Champion
January 17, 2023

Hi @Ran Wronsky 

you seem to have "Accepted" your own answer, which is not an answer to your initial question and will thus confuse other community members. Could you please instead accept the Answer that actually provides a solution to your original problem? Thanks!

0 votes
Answer accepted
David Fischer
Community Champion
January 15, 2023

Hi @Ran Wronsky 

For both cases, you should use the "is Epic of" link type. 

For Bugs, you'll need to add conditional validation to test whether priority is P0 or P1 (since you don't want to enforce anything for the other priorities)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events