I would like to prevent users from moving an epic to a Done status category if there are open child work items. Using Scriptrunner workflow script this is simple. The problem is when a story which is in an Open status category is ‘archived’ while still a child of an epic. Scriptrunner somehow gets a return code there is still an ‘open’ work item, but cannot tell me which one.
Worked with Atlassian and Adaptavist and no JQL, workflow script, automation or simple way to inform the user of the archived item blocking the close.
Using this API call The Jira Cloud platform REST API to obtain a list of archived items, does work, but sends me (an admin) a link to download a CSV file. But the filters are limited. I do see at least a dozen open Jira feature requests.
Just looking for thoughts if a Forge app can be used to see when a work item is being moved to a Done status category and either ignore the archived child work items or inform the end user which archived work items are preventing this?
Hi @WilliamBillKlein, yes. Jira expressions still see archived children, even though JQL doesn’t, so a Forge workflow validator can name them.
I archived an open story under a company-managed epic on a test site today, and it dropped out of parent = EPIC completely. Expressions behave differently. This one still returned its key:
issue.stories.filter(c => c.status.category.key != "done").map(c => c.key)
The workflow validator module accepts an expression returning a boolean or a string. Return a string and those keys show up in the error. To keep only the archived ones, a function validator can drop whatever parent = EPIC AND statusCategory != Done returns.
Caveat: that ran through the expression evaluate endpoint as an admin, and it hasn’t been deployed as a validator yet. Team-managed epics weren’t tested. JRACLOUD-99419 is your exact case.
The export is async, admin-only and Premium or Enterprise, so it can’t help mid-transition. There’s no list endpoint for archived children either (JRACLOUD-94071, JRACLOUD-83897).
Thank you for the advice! Will review