How to create a Task and its Sub-Tasks with a single click
Create an Operation
1 - Go to the Elements Copy & Sync configuration page in the Jira Administration
2 - Click on the "Add" button
The Operation configuration page is opened.
Configure the Operation
3 - Set a Name to your operation.
4 - In the "Display" tab, do NOT select any value in the "Display" option.
The Operation we are creating will only be executed during a workflow transition. It doesn't need to be available to the end-user in the Jira issue view.
5 - In the "Activation" tab, add a condition for when the Operation will be active.
In our case, we use the following JQL filter : "project = REQ and issuetype = Task and "Jira projects" is not EMPTY".
The different parts of this query are :
- project = REQ defines the project where this Operation will be available ("REQ" is the project key).
- issuetype = Task means this Operation will be performed only for Jira Tasks.
- "Jira projects" is not EMPTY is an additional condition on the Task issue we want to create. Here, "Jira projects" is the name of a Custom Fields. By adding this condition, we insure that the Sub-Task will be created along the Task only if a value has been set in the "Jira projects" Custom Fields during the Task creation.
6 - In the "Target" tab, set the issue context of the Sub-task we want to create :
- Project = Current project
- Issue type = The type of the Sub-Task we want to create
7 - Add a Fields mapping to the "Issue content" section.
This mapping needs to include the "Summary" field, which is mandatory for all issues, otherwise it is not possible to launch the Operation during an issue creation.
That's it, your Operation has been configured. This Operation creates a Sub-Task to a Task, only if a value has been selected in the "Jira projects" fields of the Task.
As the goal of the Tutorial is to create the Sub-Task at the same time as the Task, we need to configure when this Operation is launched. This is done with a Post-Function. Follow this guide to add the newly created Operation to the "Create" transition.
Once you're done, each time a Task is created in the REQ project, if a value is selected in the "Jira projects" field during the Task creation, a Sub-Task will be automatically created at the same time.