Delen via


Add a work item instance to a process template

By adding work items to your process template, you define a set of tasks or other items that act as reminders for each project manager to perform after the team project is created. For example, you can create one task each to assign permissions to team members, define product areas and milestones, set up build definitions, and determine the branch strategy for version control.

Note

Defining work item instances is optional. The process templates for Microsoft Solutions Framework (MSF) do not include any work item instances.

In this topic

  • Defining Work Item Instances

  • WORKITEMS Element Reference

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.

<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.

<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

<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

<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

<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

<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

Concepts

Customize a process template

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