Example: Create a sub-task in each Story of an Epic
This is an example of creation of multiple issues based on seed issues using Create issues and sub-tasks post-function. We are going to insert a post-function in a transition of Epic's workflow in order to create one sub-task on each Story which is in status "To Do" or "Open".
We insert Create issues and sub-tasks post-function in a transition of Epic's workflow using the following configuration:
Once configured, transition will look like this:
Seed Issues
We use the following issue list expression for selecting those issues linked to the Epic (using issue link type "is Epic of"), with issue type "Story" which are in statuses "To Do" or "Open":
filterByStatus(filterByIssueType(linkedIssues("is Epic of"), "Story"), "To Do, Open")
Parent
As the issue type of the new issues is "Sub-task", we should specify a parent issue for each of them. In this case the parent issues will be the seed issues, i.e., each of the stories selected by the former issue list expression.
Assignee
The sub-tasks will be assigned to the same user who has the parent Story assigned.
Reporter
The sub-task will be reported by the assignee of the Epic issue.
Due Date
The due date of the sub-task will be 3 days ahead skipping weekends.
We use the following formula: addDaysSkippingWeekends({00057}, 3, LOCAL)
New comment
An automatic comment will be created in each new sub-task.
We use the following text expression: "This issue was automatically generated by " + %{00015} + " Epic issue for " + ^%{00015} + " Story."
Conditional execution
We set a condition so that we ensure that the post-function is only executed when current issue is an Epic, this way we can use the post-function in workflows shared with other issue types.
Result screenshots post-function "Create issues and subtasks" - Create subtask for each Story of an Epic
Other examples of that function
- Assign new issues to a different project role depending on field value in current issue
- Clone an issue and all its subtasks (with additional restrictions)
- Create 3 issues in 3 different projects
- Create a dynamic set of sub-tasks based on checkbox selection with unique summaries
- Create a static set of sub-tasks with unique summaries
- Create a story for each component in an epic
- Create a sub-task for each user selected in a Multi-User Picker
- Create a sub-task in each story of an epic
- Create specific sub-tasks for each selected component