共用方式為


Add a work item instance to a process template

Azure DevOps Server 2022 - Azure DevOps Server 2019 | TFS 2018 - TFS 2013

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

Define a work item instance

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.

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>  

WORKITEMS elements

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 Description and syntax
FIELD Required child element of WI. Specifies the reference name of a field and the value to assign to that field.
<FIELD refname="FieldReferenceName" value="Value" />
HYPERLINK Optional child element of WI. Defines a hyperlink for the work item instance. You can specify true or false for the relative path.
<HYPERLINK URL="URL" relativePath="false" />
WI Required child element of WORKITEMS. Defines the type of work item to create and the values to assign to specific fields.
<WI type="WorkItemType">
<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.
<WORKITEMS">
<WI> . . . </WI>
</WORKITEMS>