How to create multiple issues - advanced example
Description
This builds off of How to create multiple issues and is part of release 3.3. This can be used to create subtasks or issues, the example here will be for subtasks. Advanced techniques are used to show:
- Creating issues based on information in the original issue that caused the transition - for example, creating a subtask for each version listed as a fix version.
- Subsetting the information to exclude some entries.
- Controlling duplication of issues when the same transition is done again.Â
Steps
- Follow the steps similar to How to create multiple issues
- Determine the field in the original issue that will control the number of issues to be created. For instance, this could be one of the many Substitution variables that produce a comma separated list like original_fixed_versions, role_developers, original_labels_comma_separated, or similar.
- Determine any include or exclude criteria for subsetting the entries to be considered.
- Determine if duplication prevention is needed and, if so, determine a condition that could be used to determine if the create should proceed. AÂ JQL query is a convenient way to do this.
- Configure the post function - see the example.
Example - Fix versions
- Set the multiple issues value field to use the original_fixed_versions substitution variable.
- Subset to only use versions that do not have the word sprint (case insensitive) in them.
- Set the fix version for the subtask to be created to be the selected entry.
- Set a JQL query to determine if the subtask has already been created from an earlier running of this transition or some other means. This is a way to prevent unwanted duplicates.
- Note that the JQL query is executed for each entry processed since it contains the %entry% substitution variable.
- Use the JQL query results to condition the creation of the subtask. Only create the subtask if there are no subtask for this issue that have a fix version that matches.
Quote fix version fields that may contain blanks
Use "%entry%"
What happens when there are no fix versions?
If the Create multiple issues field is replaced with blank or the regex eliminates all candidates, then no issues will be created.
How to debug your scenario
How to get problem determination information shows you how to get information about what is happening on the transition.
Example - Setting unique values for other fields
Create multiple subtasks on transition that have different assignees discusses some of the techniques that can be used. Provide substitution variables for custom field option values provides the basic enablement for this.