Hello,
I hope you are doing well!
I would like to create an validator in Jira Cloud - workflow for epic, that, if children are not done I cannot close the issue, this part i created with the scriptrunner validator, but it includes some issue types that are not relevant, ('Test', 'Test Execution', 'Test Plan', 'Precondition', 'Test Run'). How can I modify this validator to not include this issues, means that if I have them as a child, I will be able to close the issue!
issue.isEpic && issue.stories.every(story => ( story.status.name == 'Done' || story.status.name == 'Resolved' || story.status.name == 'Closed' || story.status.name == 'Mitigated' || story.status.name == 'Duplicate' || story.status.name == 'Defer' || story.status.name == 'Rejected') )
Thanks!
Regards,
David
Hi @David Plesu
I am from Forgappify, and we developed the Linked Issues Validator, which has a wizard that can help you build such expressions. After selecting relevant options, you will find below a Jira expression preview, which you can copy and modify further.
So in your case, you need to basically add a filter clause before .every call. Also you could use statusCategory instead of statuses.
You don't want to check 'Test', 'Test Execution', 'Test Plan', 'Precondition', 'Test Run', therefore you need to add ! before the list.
.filter( issue => !['Test', 'Test Execution', 'Test Plan', 'Precondition', 'Test Run'].includes(issue.issueType.name)))
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @David Plesu !
Let me know if this validator works for you:
issue.isEpic && issue.stories.every(story => (
story.status.name == 'Done' ||
["Test", "Test Execution", "Test Plan", "Precondition", "Test Run"].includes(story.issueType.name) ||
["Resolved", "Closed", "Mitigated", "Duplicate", "Defer", "Rejected"].includes(story.status.name)
))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.