Skip to content

Latest commit

 

History

History
471 lines (275 loc) · 21.7 KB

work-item-template.md

File metadata and controls

471 lines (275 loc) · 21.7 KB
title titleSuffix description ms.technology ms.prod ms.assetid ms.manager ms.author author ms.topic ms.date
Work item templates
VSTS & TFS
Add and manage work item templates to pre-populate fields in work item forms in Visual Studio Team Services & Team Foundation Server
devops-agile
devops
9b575c05-16f3-4027-aa5a-67b017a0089d
douge
kaelli
KathrynEE
conceptual
03/20/2018

Use templates to add and update work items

VSTS | TFS 2018 | TFS 2017 | TFS 2015 | TFS 2013 | Visual Studio

With work item templates you can quickly create work items which have pre-populated 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.

Note

Work item templates are distinct from process templates. For information on process templates, see Choose a process template or these specific topics for the default process templates: Agile, Scrum, or CMMI.

::: moniker range="vsts || >= tfs-2017 <= tfs-2018" Note that within the browser context or web portal, work item templates are associated with a team. Only those templates defined for a team are accessible when working in a team context, either through a work item form or bulk update context menu.

::: moniker-end

Capture a work item as a template

The steps to capture a work item differ based on the platform, version, and client you use.

::: moniker range="vsts || >= tfs-2017 <= tfs-2018"

  1. Open a work item with the fields defined that you want to capture, and click the Actions icon actions icon to open the menu. Choose Templates and then Capture.

    Capture work item field definitions as a template
  2. Name the template and optionally add and remove fields. Save the template when finished.

    Capture template dialog
  3. Once you've saved the template, click Copy link to capture the URL for the template that you can use to add work items using the template.

    The URL identifies the team and template ID, for example:

    http://fabrikamfiber:8080/tfs/DefaultCollection/Fabrikam%20Fiber/Web/_workItems?_a=new&witd=Bug&templateId=15ffa521-7a1d-486e-9f71-a58c0b338d87
    
  4. Use the URL whenever you want to add a work item of the type you've defined with its predefined values.

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

::: moniker-end

::: moniker range=">= tfs-2013 <= tfs-2015"

If you connect to an on-premises TFS and primarily create work items working in the web portal, you can create a hyperlink that captures the default values you specify for a template. Click the hyperlink, and it opens the template in the web portal.

  1. From the web portal Queries page, open a new work item.

    Open a new work item from the web portal Work page

  2. Fill in the default values you want the template to specify. You can leave required fields empty, or place some text in them

    Here, we fill in several values, including tags, but leave the Title blank. When you're done, copy the URL for the template.

    Define fields and choose Copy the URL

  3. The URL defines each predefined field, for example (line breaks added for clarity):

    http://fabrikamprime:8080/tfs/DefaultCollection/Fabrikam%20Fiber/_workItems/create/Task?%5B
    System.AssignedTo%5D=Jamal+Hartnett&%5B
    System.Description%5D=%3Cp%3EAlways+include+Remaining+Work+and+links+to+any+related+bugs+or+user+stories.%3C%2Fp%3E&%5B
    System.Tags%5D=Web%3B+Phone%3B+Service&%5B
    Microsoft.VSTS.Common.Activity%5D=Development&%5B
    System.IterationPath%5D=Fabrikam+Fiber%5CIteration+1
    

    [!TIP]
    The URL won't contain defaults defined for the work item type. To specify a default field value, see Add or modify a field. Also, there's a 2000 character limit recognized by browsers. There's no work around to that limit.

  4. Use the URL whenever you want to add a work item of the type you've defined with its predefined values.

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

::: moniker-end

If 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 from Microsoft Visual Studio Team Foundation Server 2015 Power Tools.

  1. Open or run a query that lists the work item whose fields you want to capture.

  2. Right-click the work item of the type and whose fields you want to capture, and select Capture Template from the context menu.

    Capture work item field definitions as a template from Visual Studio with Power Tools installed
  3. In the dialog, use the checkboxes to select all the fields you want to save in the template, and add a name and (optionally) description to the template.

    Capture template dialog from Visual Studio with Power Tools installed
  4. Save the template and it will appear in the root of the Team Explorer pane under the Templates section.


Add a work item using a template

The main method for adding a work item using a template is to open the template link within a browser window. You can then share these links through email, a network share, team portal, or a team dashboard or Welcome page.

Copy the link to a template

::: moniker range="vsts || >= tfs-2017 <= tfs-2018"

  1. Click the Actions icon actions icon and choose Copy link.

    Copy link of a template
  2. Copy the link to a shared network or send to your team via email. Also, consider adding a link the team dashboard.

    The link is a URL to the web portal, for example:

    http://fabrikamfiber:8080/tfs/DefaultCollection/Fabrikam%20Fiber/Web/_workItems?_a=new&witd=Bug&templateId=15ffa521-7a1d-486e-9f71-a58c0b338d87
    
  3. Use the URL whenever you want to add a work item of the type you've defined with its predefined values.

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

::: moniker-end

::: moniker range=">= tfs-2013 <= tfs-2015"

See Capture a work item as a template for TFS web portal.

::: moniker-end

  1. You can copy the link to a template which will open in the web portal, by opening the context menu for the template.

    Copy link to template from Visual Studio with Power Tools installed
  2. Paste the copied link into a web browser to check that it works as expected.


::: moniker range="vsts || >= tfs-2015 <= tfs-2018"

Add a template link to the dashboard

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

::: moniker-end

::: moniker range="tfs-2015"

Note

Multiple team dashboards and the Markdown widget are available for VSTS and TFS 2015.2 and later versions.

::: moniker-end

::: moniker range="vsts || >= tfs-2015 <= tfs-2018"

For example, the following widget contains links to three templates.

Markdown widget with links to templates

To learn more about the markdown widget see Add Markdown to a dashboard, Markdown widgets.

::: moniker-end

Apply a template to existing work item(s)

You can apply a template to a single work item or perform a bulk update of several work items.

# [Browser](#tab/browser)

::: moniker range="vsts || >= tfs-2017 <= tfs-2018"

  1. Open the work item that you want to update using the fields defined within a template, and click the actions icon actions icon to access your menu. Click Templates and then click the name of a pre-defined template.

    Apply a template to an existing work item within the form

    [!TIP]
    Refresh your browser to discover the latest templates that have been added. If you don't see any templates, it may be that there are none defined for the work item type. Click Manage� to open the team settings Templates admin page for your team to review or add templates.

  2. Save the work item for the changes to be applied. The fields changed are noted in the History field.

::: moniker-end

::: moniker range="vsts || >= tfs-2013 <= tfs-2018"

Apply a template to several work items (bulk update)

  1. To bulk update several work items, first select them from the backlog or a query results list, and then open the actions menu for one of them. All work items you select must be of the same work item type. For example, all user stories or all bugs.

  2. Choose the template to apply.

    Bulk update several work items
  3. Field changes are automatically applied and work items saved. To learn more about bulk updates, see Bulk modify work items.

::: moniker-end

  1. Open or run a query that lists the work item(s) whose fields you want to capture.

  2. Right-click the work items—which must be of the same type— and click Apply Template from the context menu.

    Apply template to selected work item from Visual Studio with Power Tools installed
  3. Select the template to use and click OK.

    Apply template dialog from Visual Studio with Power Tools installed
  4. Save the work item.

    Save changes from Visual Studio with Power Tools installed

Manage work item templates

::: moniker range="vsts || >= tfs-2017 <= tfs-2018"

You can view the list of templates defined for each work item type, and also add, edit, copy, delete, and copy the link of a template. All templates are defined and managed for a team.

You manage templates from the team admin context. All templates are defined for a team.

  1. From a web browser, open the web portal administrative context for your team. Here we open the admin page for the Web team.

    Open team admin context

    If you're not a team administrator, get added as one. Only team or project administrators can change team templates.

  2. Click Templates under the Work hub.

    Open Work - Templates page for team

    From here, you can click any work item type to view or add templates for that type.

Manage templates for a work item type

Click the work item type to view the templates defined for each type.

For example, click User Story to view templates defined to capture user stories.

Manage user story templates

Define a template from scratch

  1. From the work item type page, click green plus icon New template to create a template from scratch.

    Add a user story template
  2. Name the template and optionally add and remove fields. Save the template when finished.

    Once you've saved the template, click Copy link to capture the URL for the template that you can use to add work items using the template.

Edit, delete, or copy link to a template

From the work item type page, click actions icon the actions icon for an existing template to access the menu options to Edit, Delete, or Copy link.

Open template action menu

Copy or duplicate a template

  1. To duplicate an existing template, click actions icon the actions icon for an existing template and click Create copy.

    Copy an existing template
  2. Name the template and optionally add and remove fields. Save the template when finished.

::: moniker-end

::: moniker range=">= tfs-2013 <= tfs-2015" Managing work item templates from the web portal is only supported from TFS 2017 and later versions. For TFS 2013 and TFS 2015, you can manage work item templates in Visual Studio 2013 or Visual Studio 2015 by downloading TFS Power Tools. With the Work Item Templates power tool add-in, you can:

  • Create and edit work item templates
  • Create and update work items using a template
  • Create a template from an existing work item
  • Bulk-edit work items by applying a template
  • Use templates created in Visual Studio to create work items through the Visual Studio client.

Note

Visual Studio 2015 is the last version in which you can install TFS power tools. You can use the Work Item Templates tool whenever you connect to TFS 2015 version or an earlier version. Templates you define through the power tool are separate from those defined through the web portal for TFS.

::: moniker-end

If Visual Studio with power tools installed, you can view the list of templates defined for each work item type, and also add, edit, copy, delete, and copy the link of a template.

You manage templates from the Team Explorer pane.

Templates, Team Explorer with power tools installed

The root Templates node represents the parent of all of your templates. You may create a directory structure underneath it by adding folders —right-click on the Templates node or a folder and select New Folder from the context menu.

You can cut, copy, paste, rename, and delete templates and folders using the context menu. You may also drag and drop templates into folders. To edit multiple templates, use shift-click to select a range or ctrl-click to add individual templates to your selection, then right-click.

  1. From the Templates section, right-click Templates and choosee to create a template from scratch.

    Add a new template, Visual Studio
  2. Save the template, provide a Name in the dialog provided.

    Add a new template, Visual Studio

    Once you've saved the template, click Copy link to capture the URL for the template that you can use to add work items using the template.

Edit, use, copy, or delete a template

To edit, delete, or perform another action on a template, open its context menu (right-click) and choose the option you want.

Open template action menu

To make frequently-used templates more accessible, you can set a default template for each work item type. To do so, right-click on a template in Team Explorer and click Set As Default. A checkmark will appear on the icon to indicate that it is now the default.

Set your template directory

To change the directory where templates are stored, click the Configure link, or navigate to it via Tools>Options>Microsoft Team Foundation Server>Work Item Templates. Use this dialog to set your template store path. Place your templates in a network location to share them with your team.


::: moniker range="vsts || >= tfs-2017 <= tfs-2018"

Add or remove tags from templates

You can add tags to a template and they'll be applied to the work item when you use the template.

Edit bug template, add or remove tags

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

::: moniker-end

::: moniker range="vsts"

Create links to work items

You can't create templates that contain default links to work items. However, you can use the Marketplace extension, Work item form one click actions, to create rules that support adding linked work items with a single click.

Otherwise, you can quickly copy tasks, test cases, bugs, and other items using Excel to apply parent-child links in a tree list. To learn more, see:

Another option is to use Excel to apply parent-child links in a tree list.

::: moniker-end

::: moniker range=">= tfs-2013 <= tfs-2018"

Templates and links to other work items

You can't create templates that contain default links to work items. However, you can quickly copy tasks, test cases, bugs, and other items using Excel to apply parent-child links in a tree list. To learn more, see:

Another option is to use Excel to apply parent-child links in a tree list.

::: moniker-end