How to configure templates for task creation using @CurrentIteration in Azure DevOps

47 Views Asked by At

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

enter image description here

How to fix this issue with @CurrentIteration in Iteration path?

2

There are 2 best solutions below

0
Shamrai Aleksander On

You should not customize @CurrentIteration value. 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:

enter image description here

1
Bright Ran-MSFT On

In the work item templates, you need to use the exact values to set the Iteration Path. It is not supported to use the @CurrentIteration macro to set the Iteration Path in the work item templates.

The value of @CurrentIteration is dynamical and will always point to the Iteration Path that contains current date. The @CurrentIteration macro generally can be used in work item queries.

When creating a new work item:

  • If the new item is created under an existing parent item, this new item will inherit the same Iteration Path from the parent item by default.

  • If the new item is not created under an existing parent item, it will use the value of @CurrentIteration by default.