Add a work item instance to a process template

Visual Studio Team Foundation Server 2013

Defining Work Item Instances

To define a work item instance, you specify the work item type along with field values for those work items. You use the WI and FIELD elements that are contained within the WORKITEMS element. You specify the set of work item instances within a taskXml element in the WorkItemTracking plug-in file. Each work item instance must conform to the schema definition for work items, which is defined in the WorkItemMethodology.xsd file. You can download the schema files for tracking work items from the following page on the Microsoft website:

Process Template and Work Item Schemas for Visual Studio Team Foundation.

The type attribute for the WI element specifies which work item type is being created, such as task, user story, or issue. You must assign values to each required field based on the type of work item.

The following example specifies a work item task that reminds project administrators to assign team members to one or more security groups. Values are assigned to all required fields. Because work item instances depend on the type definitions for work items, you must specify the task for creating work item instances after the task for creating work item types.

 Copy imageCopy Code
<task id="WIT_Instances" name="Work Item tasks definitions" plugin="Microsoft.ProjectCreationWizard.WorkItemTracking" completionMessage="Work item instances created"> 
   <dependencies>
      <dependency taskId="WITs" />
   </dependencies>
   <taskXml>
       <WORKITEMS>
       <WI type="Task">
          <FIELD refname="System.Title" value="Setup: Set Permissions" />
          <FIELD refname="System.IterationPath" value="$$PROJECTNAME$$\Iteration 0" />
          <FIELD refname="System.State" value="Active" />
          <FIELD refname="System.Reason" value="New" />
          <FIELD refname="System.Description" value="Using the admin UI in Visual Studio adds team members to one of the three groups: Project administrators, Contributors, or Readers." />
         </WI>
      </WORKITEMS>
   </taskXml>
</task>

Back to top

WORKITEMS Element Reference

The following syntax shows the structure of the WORKITEMS element and its child elements. You specify these elements within a taskXml element in the WorkItemTracking plug-in file.

 Copy imageCopy Code
<WORKITEMS>
   <WI type="TypeA">
      <FIELD refname="Field1" value="Value1" />
      <FIELD refname="Field2" value="Value2" />
      . . .
      <FIELD refname="FieldN" value="ValueN" />
   </WI>
   . . .
</WORKITEMS>

Element

Syntax

Description

FIELD

 Copy imageCopy Code
<FIELD refname="FieldReferenceName" value="Value" />

Required child element of WI.

Specifies the reference name of a field and the value to assign to that field.

HYPERLINK

 Copy imageCopy Code
<HYPERLINK URL="URL" relativePath="false" />

Optional child element of WI.

Defines a hyperlink for the work item instance. You can specify true or false for the relative path.

WI

 Copy imageCopy Code
<WI type="WorkItemType">
   <FIELD> . . .</FIELD>
   <HYPERLINK> . . .</HYPERLINK>
</WI>

Required child element of WORKITEMS.

Defines the type of work item to create and the values to assign to specific fields.

WORKITEMS

 Copy imageCopy Code
<WORKITEMS>
   <WI>
      <FIELD> . . .</FIELD>
      <HYPERLINK> . . .</HYPERLINK>
   </WI>
</WORKITEMS >

Optional child element of the taskXml element for the WorkItemTracking plug-in.

Contains a collection of WI elements that each define a work item instance.

Back to top

See Also