How to block creation of sub-tasks for an issue with child sub-tasks

This article explains how to block creation of sub-tasks if the parent issue has existing sub-tasks using the Create on Transition app.

Instructions

  1. Add a post-function to the intended transition to create a sub-task. To add a post-function, navigate to Cog wheel () > Issues > Workflows, select the workflow of the project, and edit the same.
  2. Select the Create Sub-task post function as shown:
  3. Select the Conditions & Configuration, add %jql_result_count% in Condition 1 and "0" in Regular expression pattern, and select the Exact field under ConditionsUse the condition and regular expression values to check for the JQL query available under the Configuration section.

  4. Add the value parent = %original_key% under the Configuration section in the JQL query. It checks whether the parent issue has sub-task(s) for the specific transition and creates new sub-task(s) accordingly.
  5. Click Update to save the settings. Verify the condition:
  6. Publish the workflow draft.
  7. Perform the In Progress transition. Note that issues are created based on the condition and if the transition is repeated, it does not create any duplicate sub-tasks.

It is recommended to try the provided solution in a non-production environment and ensure everything is working as expected, before trying in a production environment.