Partager via


Use work item templates to pre-populate fields

A work item template lets you pre-populate values for your team's commonly used fields. For example, you can create a task template that will set the area path, iteration path, and discipline or activity whenever you use it to create a task.

If you primarily create work items working in Team Web Access (TWA), you can create a hyperlink that captures the default values you specify for a template and opens the template in TWA.

If, however, you primarily work in Visual Studio or Team Explorer, and want to create work items from templates that you can access from the Work Items page, you can create work item template files (extension .wt). You create these files using Work Item Templates, a power tool for Visual Studio, which you can download here: Team Foundation Server Power Tools.

To create a TWA-based work item template

  1. From the Work page, open a new work item.

    Open a new work item from the Work page (TWA)

  2. Fill in the default values you want the template to contain and then copy the URL for the template.

    Define fields and choose Copy the URL (TWA)

    Assign values to each field that you want to have automatically defined by your template. You can leave required fields empty, or place some text in them.

  3. In notepad, or other text editor, paste the URL that you just copied. For example (line breaks added for clarity):

    http://fabrikamprime:8080/tfs/DefaultCollection/Fabrikam%20Fiber%20Website/_workItems/create/Task?%5B
    System.AssignedTo%5D=Raisa+Pokrovskaya+(Fabrikam)&%5B
    System.Description%5D=Always+include+Remaining+Work+and+links+to+any+related+bugs+or+PBIs.&%5B
    Microsoft.VSTS.Common.Activity%5D=Development&%5B
    System.AreaPath%5D=Fabrikam+Fiber+Website%5CFabrikam+Database
    
  4. Use the URL whenever you want to create a work item of the type you've defined with its default values.

    You can save the URL as a text file or add the URL to a Web page as a hyperlink.

To specify default field values or text on a form