How to automate sub-task creation through labels by using Create on Transition

This article explains how sub-task creation can be automated based on the label field while creating an issue.

Instructions

In this case, the sub-task creation is automated on the create transition when labels are empty (or) to restrict the creation of sub-tasks based on the specific labels.

  1. Log in to Jira as an Administrator.
  2. Click on > Projects > Project Settings
  3. Select the workflow that is associated with the project and click on Edit
  4. Click Add post function link and select Create Sub-task from the list and click Add
  5. Configure the Create Sub-task post function as shown below with the JQL:

    project = KPS AND key = %original_key% AND (labels != No_Subtasks OR labels is EMPTY)

    Note: The above JQL will check for the issues and return results for the labels that are empty or the values not equals to No_Subtasks



  6. Publish the workflow.
  7. Create a sample ticket and test if the sub-task is created or not.