Issues created from templates can be automatically assigned to active sprints. The sprint selection is calculated based on the sprint pattern in a template.
Example for Sprint name pattern
Matched sprint name
Sprint dev 2
\s means empty space, \d means any digits
You can test provided pattern on this page: https://regex101.com/
Make sure you have the Sprint field added to the associated screen.
On the create or edit the template, select Sprint board and provide a pattern for a sprint name.
Save changes on the template.
When the sprint matches, the issue created from template is added to the sprint.