Edit

Share via


Use work item templates

Azure DevOps Services | Azure DevOps Server 2022 | Azure DevOps Server 2020

Visual Studio 2022 | Visual Studio 2019 | Visual Studio 2017 | Visual Studio 2015

Work item templates help you quickly create work items with prepopulated values for your commonly used fields. You can use work item templates to create work items or make bulk updates to several work items. This article describes how you can add and manage work item templates from the web portal or from Visual Studio 2015 or earlier versions. For examples that demonstrate how to use the work item templates, see Sample work item templates.

Work item templates are distinct from process templates. For more information, see About processes and process templates or these specific articles for default process templates: Basic, Agile, Scrum, or Capability Maturity Model Integration (CMMI).

Prerequisites

Prerequisite Description
Permissions - To manage work item templates in the web portal, be a member of the team that owns the templates. You can then add, edit, or delete templates as needed.
- To use work item templates in the web portal, be a Contributor to the project. You can then apply templates to existing work items.
Tools - To add, capture, or edit work item templates by using Visual Studio Team Explorer, install the Microsoft Visual Studio Team Foundation Server 2015 Power Tools. These templates only appear in your view of Team Explorer.

Supported template tasks

The availability of template task options depends on your client and platform configuration. You can add and manage work item templates from the web portal or from Visual Studio 2015 or earlier versions.

The following table shows the support for tasks in the web portal and Visual Studio 2015 or earlier versions. If you use the Task description links to jump to the corresponding sections, be sure to select the content version (tab) in the section for your platform configuration, as appropriate.

Template task Web portal Visual Studio
Capture a work item as a template ✔️ ✔️
Manage work item templates
(Define, edit, delete, copy link, create copy, and rename)
✔️ ✔️
Copy the link (URL) of a template ✔️ ✔️
Add a work item by using a template ✔️ ✔️
Define a work item template ✔️ ✔️
Apply a template to one or more work items ✔️ ✔️
Add or remove tags from templates ✔️
Define a template with a hyperlink ✔️

Restrictions for using templates

The templates defined in the web portal are distinct from templates defined through Visual Studio.

  • Web portal templates can only be managed and applied to work items through the web portal.
  • Visual Studio templates can only be managed, viewed, and applied to work items in Visual Studio.

However, you can use the URLs of both template types to add work items through the web portal.

Capture a work item as a template

Depending on the platform, version, and client you use, you might need to follow different steps to capture a work item. The following sections provide procedures for the web portal and Visual Studio 2015 and earlier versions.

Azure DevOps assigns a unique GUID identifier to each template captured through the web portal. Use the following procedure to capture a work item as a template through the web portal and access a link for the saved template:

  1. From the web portal, open a work item to use as the basis for a template.

  2. At the right, select More actions > Templates > Capture:

    Screenshot that shows how to select the capture work item field definitions as a template option from the More actions menu.

  3. In the Capture Template dialog, configure the required fields, and any optional fields:

    • Team: (Required) Use the dropdown list to select an existing team to associate with the captured template.

    • Name: (Required) Enter a name for the template.

    • Fields: Use the Add action to add fields, the Delete action to remove fields, and adjust any specific field Value as needed.

    • Notes: Select inside the box to add more information about the template. When you select inside the box, the editing tools display. When you create a new work item from the captured template, your information is added as the first entry in the Discussion thread.

    Screenshot that shows how to configure fields on the Capture template dialog in the web portal.

  4. Select Save, and then select Copy link to capture the URL for the template.

    Use the URL whenever you want to add a work item of the same type with predefined values. Here are some examples:

    • Create a work item based on the captured template by pasting the URL link in a browser window.
    • Share the URL with others for their own use when adding work items.
    • Add the URL as a hyperlink to a project wiki.
    • Add the URL to a Markdown widget on a team dashboard.

Manage work item templates

For each work item type, you can view and manage the templates defined by your team. Perform various actions on the templates like add, edit, copy, delete, or rename, and get a link to the template.

Use the following procedure to access work item templates through the web portal:

  1. From the web portal, open Project settings.

  2. In the Boards section, select Team configuration. If you need to switch to a different team, use the Team selector in the breadcrumb trail for the page.

  3. In the Boards page, select the Templates section:

    Screenshot that shows how to access the list of saved templates in Azure DevOps from Project settings, Boards, Team configuration, Templates.

  4. Select a work item type, such as Bug, Feature, or Test Case to view or add templates for that type:

    Screenshot of templates defined for the Bug work item type.

Create a work item template

Use the following procedure to create a work item template through the web portal:

  1. In the work item type page, select New template to create a template from scratch:

    Screenshot showing how to add a new template for the Bug work item type.

  2. In the New Template dialog, enter a Name for the template (required) and optionally add fields with any necessary values.

  3. Select Save. The Copy link option becomes available. You can use this URL to create work items based on the template.

After you have a saved template, you can edit or delete the template, create a sharable link to the template, or create a copy of the template.

From the work item type page, select More actions for an existing template and then select a menu option:

Screenshot of the More actions menu options for a selected template.

  • Edit: To update the template, select Edit, make your changes, and select Save.

  • Delete: To remove the template, select Delete. In the confirmation dialog, select Delete. After you delete a template, you can't recover it.

  • Copy link: To get a copy of the URL for the template, select Copy link. Use the URL whenever you want to add a work item of the same type with predefined values. You can save the URL as a text file, add it to a web page as a hyperlink, copy the link to a shared network, or send it to your team via email. Also, consider adding a link to the team dashboard.

  • Create copy: To make a copy of the template, select Create copy. Enter a name for the template copy, and optionally add, remove, and update fields. Select Save when you're done.

Add a work item by using a template

The most common approach for adding a work item by using a template is to open the template link within a browser window.

  1. To get the template link, see the Edit, delete, copy link, create copy section.

  2. To create the new work item, paste the template link in a browser window, configure the required fields, and save your changes.

Apply a template to new or existing work items

You can apply a template to a new or existing work item or do a bulk update of several existing work items.

In the web portal, you can apply a template within an open work item or to selected work items.

Apply a template within a work item

Use the following procedure to apply a template to a new or existing work item:

  1. Open a new work item or an existing work item that you want to update by using the fields defined within a template.

  2. Select More actions > Templates, and then select the name of a predefined template:

    Screenshot that shows how to apply a template to an existing work item within the form.

    Note

    The Templates list shows templates defined for teams of which you're a member. If the list is empty, there might not be any templates for the work item type. Refresh your browser to discover the latest available templates.

  3. Select Save to apply the selected template. Any field changes are noted in the work item History field.

Apply a template to several work items

Use the following procedure to apply a template to selected work items for a bulk update:

  1. Select the work items from the Backlog or a Queries results list. All work items you select must be of the same work item type, such as Bug or Feature.

  2. Select More actions > Templates for one of the selected work items, and select the template to apply.

    Screenshot that shows how to apply a template to multiple work items for a bulk update.

The field changes are automatically applied and the work items saved. Any field changes are noted in the work item History field. For more information about bulk updates, see Bulk modify work items.

Add or remove tags from templates

In Visual Studio 2015 or earlier, you can add tags to a template and they're applied to the work item when you use the template. To add two or more tags, separate them with a comma (,). This task isn't available in the web portal.

Screenshot of the Edit template dialog showing how to add or remove tags.

If you don't specify tags to remove, then all tags present in a work item remain defined. The tags remain defined even when you apply a work item template to an existing work item.

In Visual Studio 2015 or earlier, you can specify a work item template that defines several field values by using the following syntax. You can use the URL whenever you want to add a work item of the same type with predefined values. This task isn't available in the web portal.

https://dev.azure.com/<Organization_Name>/<Project_Name>/_workItems/create/<Work_Item_Type>?
[FieldReferenceName 1]={FieldValue 1}&
[FieldReferenceName 2]={FieldValue 2}&
[FieldReferenceName 3]={FieldValue 3}&
. . .
http://<Server_Name>:8080/tfs/DefaultCollection/<Project_Name>/_workItems/create/<Work_Item_Type>?
[FieldReferenceName 1]={FieldValue 1}&
[FieldReferenceName 2]={FieldValue 2}&
[FieldReferenceName 3]={FieldValue 3}&
. . .

For example, the following code specifies a work item task with the Title TaskTitle. The syntax specifies values for the Assigned To, Description, Tags, Activity, and Iteration Path fields.

https://dev.azure.com/<Organization_Name>/<Project_Name>/_workItems/create/Task?
[System.Title]=TaskTitle&
[System.AssignedTo]=Jamal+Hartnett&
[System.Description]=<p>Always+include+Remaining+Work+and+links+to+any+related+bugs+or+user+stories.</p>&
[System.Tags]=Web;+Phone;+Service&
[Microsoft.VSTS.Common.Activity]=Development&
[System.IterationPath]=Fabrikam+Fiber%5CIteration+1
http://<Server_Name>:8080/tfs/DefaultCollection/<Project_Name>/_workItems/create/Task?
[System.AssignedTo]=Jamal+Hartnett&
[System.Description]=<p>Always+include+Remaining+Work+and+links+to+any+related+bugs+or+user+stories.</p>&
[System.Tags]=Web;+Phone;+Service&
[Microsoft.VSTS.Common.Activity]=Development&
[System.IterationPath]=Fabrikam+Fiber%5CIteration+1

Note

Some browser clients impose a 2,000 character limit for field values.

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

You can add links to a Markdown widget on your team dashboard in the web portal. These links open a work item with the template-defined fields predefined.

The following example shows a widget with links to three templates:

Screenshot of a Markdown widget with links to templates.

For more information, see Add Markdown to a dashboard, Markdown widgets.