Partager via


Add link type definitions to a process template

You can define additional types of links that team members can create between work items for a team project. A type of link defines the labels and rules that govern the relationships or links between work items of that type. The link types that you specify supplement the default types for hierarchical, dependent, and related links. You specify the definition file for each type of link in a separate file, or you can specify them all in one file. You then specify the definition files to upload within the taskxml element of the WorkItemTracking plug-in.

The Team Foundation Server (TFS) process templates define two types of links that are referenced in the definitions of several types of work items. These are in addition to the system defined link types. For more information, see Link type element reference.

The type definitions for links must be uploaded before the type definitions for work items. For more information, see Define dependencies for task groups and tasks in plug-in files.

After a team project is created, you can add, remove, rename, and change the types of links for a team project collection by using the witadmin command-line tool. For more information, see Manage link types [witadmin].

You must specify each link type definition using the LinkType element. In addition, each definition must conform to the schema definition for link types, which are defined in the workitemlinktypedefinition-01.xsd file. You can download the schema files for tracking work from the following page on the Microsoft website: Process Template and Work Item Schemas for Visual Studio Team Foundation.

The following example shows the syntax structure that defines the TestedBy link type.

<?xml version="1.0" encoding="utf-8"?>
<LinkTypes>
  <LinkType ReferenceName="Microsoft.VSTS.Common.TestedBy" ForwardName="Tested By" ReverseName="Tests" Topology="Dependency" />
</LinkTypes>

You can customize or create definition files for types of links in the LinkTypes folder. For more information about how to define a type of link, see Define a custom link type.

Back to top

To upload a link type definition in the process template, you specify the LINKTYPE element within the taskxml element. The filename attribute is a relative path of the definition file for the link type. For example, the following syntax specifies that the TestedBy.xml file will be uploaded.

<LINKTYPE fileName="WorkItem Tracking\LinkTypes\TestedBy.xml" />

The following example shows how to specify a task that creates the two types of links that are defined in the process template for MSF for Agile Software Development v5.0. These types correspond to the SharedStep and TestedBy link types.

<task id="LinkTypes" name="LinkType definitions" plugin="Microsoft.ProjectCreationWizard.WorkItemTracking" completionMessage="Work item link types created">
   <taskXml>
      <LINKTYPES>
         <LINKTYPE fileName="WorkItem Tracking\LinkTypes\SharedStep.xml" />
         <LINKTYPE fileName="WorkItem Tracking\LinkTypes\TestedBy.xml" />
      </LINKTYPES>
   </taskXml>
</task>

Back to top

LINKTYPES element reference

The following table describes the elements that you use to upload link type definitions. You specify these elements within a taskXml container element in the WorkItemTracking plug-in file.

Note

You specify the file that defines link types to upload by using the LINKTYPE (WorkItemTracking) element. You specify the name of a link type to define by using the LinkType (Definition) element.

Element

Syntax

Description

LINKTYPE

<LINKTYPE fileName="LinkTypeFilePathName" />

Required child element of LINKTYPES.

Specifies the path and name of a file that contains a link type definition to upload.

LINKTYPES

<LINKTYPES>
     <LINKTYPE />
 . . .
</LINKTYPES>

Optional child element of the WorkItemTracking plug-in.

Contains a collection of LINKTYPE elements that each specify a definition file to upload.

See Also

Reference

Manage link types [witadmin]

Concepts

Define objects for tracking work items using the work Item tracking plug-in

Other Resources

Define a custom link type