Multi-part Request | Restrict Parent tasks from closing IF it has subtasks that were created during a given parent-issue status

Issue #132 resolved
Will created an issue

Desired outcome: If Sub tasks are raised while the parent is at a status of ‘Released’, the Parent cannot be moved to status ‘Closed’ until all Sub tasks are closed.

Notes: I believe this will require a new custom field to be populated automatically during the sub-task's Create step that contains the parent-issue's status.

The logic should then check if parent-issue status field in subtask = "Released", then if so, require it to be Closed before the parent can be closed.

Comments (2)

  1. Fidel Castro Armario repo owner

    Hi Will,

    You are right. I explain step by step how to do it:

    1) Create a "Text field (single line)" custom field in subtask issue called "Parent status at subtask's creation".

    2) Insert post-function "Copy a parsed text to a field" into subtask's "Create Issue" with the following configuration:

    conf-1.png

    Notice that:

    • %{00042} is field code for "Parent's issue status" virtual field.
    • Beware to introduce that post-function after "Creates the issue originally" system post-function.

    3) Insert "Boolean validator with math, date-time or text-string terms" validator into "Close issue" transition in parent's workflow with the following configuration:

    conf-2.png

    Boolean expression used is:

    count(filterByPredicate(subtasks(), ^%{11900} = "Released" AND ^%{00016} != "Closed")) = 0

    Notice that:

    • %{11900} is field code for "Parent status at subtask's creation" custom field in my particular JIRA instance. You should replace 11900 with the field code in your JIRA instance.
    • %{00016} is field code for "Issue status".
  2. Log in to comment