Add Type Definitions for Work Item Links 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.

Important

The process templates for Microsoft Solutions Framework (MSF) v5.0 define two types of links that are referenced in the definitions of several types of work items. 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.

In this topic

  • Defining Link Types

  • Specifying Link Type Definitions to Upload

  • LINKTYPES Element Reference

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 Customizing and Managing 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 Link Types.

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. For more information, see Link Type Element Reference.

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.

Back to top

See Also

Reference

Customizing and Managing Link Types [witadmin]

Concepts

Define and Customize Objects for Tracking Work Items By Using the Work Item Tracking Plug-in

Other Resources

Define Link Types