Sub-task Default Field
Here we describe how to set up default fields for the Create sub-tasks action, where the default values are derived from the parent issue fields.
The key to this is getting the parent issue ID via the parentIssueId
form field. Once you have that you can load that issue, get the fields, and set them in the Create Issue dialog.
You should use the behaviour initialiser script section to set the default values within your form.
How to get the parent Issue in behaviours
The following sample code demonstrates how to:
- Get the parent issue object using the value of the
parentIssueId
form field. - Copy the parent issue's summary to the sub-task summary field.
How to copy common system fields and custom fields
The following sample code demonstrates how to:
- Get the parent issue object using the value of the
parentIssueId
field. - Copy common system fields values to the sub-task Create Issue dialog form.
- Copy custom field values to the sub-task Create Issue dialog form.
This sample code demonstrates copying all fields from the parent to the new sub-task. In practice, you will want to select only the system and custom fields you need, by editing this example.