The template is composed of:
Any issues linked to the main issue
Any sub-tasks in the main issue or issues linked to it
An example of a template looks like on the picture below:
To create issues linked to Main Issue you can use any issues type you have configured in your JIRA instance.
Linked issues may belong to any project created in your JIRA instance.