I have created a template to generate task under the user story in Azure DevOps board. However, while using this template, encountering error for Iteration path where I have used @CurrentIteration.
Template location: [Project Settings >> Team Configuration >> Templates >> Task]
Error message:
ADD A NEW LINKED WORK ITEM : Could not create work item. Error: TF401347: Invalid tree name given for work item -1, field 'System.IterationPath'.. Please check the template used in this action
How to fix this issue with @CurrentIteration in Iteration path?

You should not customize
@CurrentIterationvalue. This Value is dynamically calculated from the Team Settings. You have to add your template to the corresponding team with the default@CurrentIteration. You may switch a team here: