Support bug update status using My Work

If you have customized the workflow states for work item types that you use to track bugs, you may need to update the metastate associations made for the process configuration. In addition to how these associations are used for the backlog and task board pages, they also control how the My Work feature in Team Explorer updates the bug state as developers move bugs within the My Work interface. The My Work page in Team Explorer allows developers to manage their work in progress, suspend and resume work, and request code reviews. See Day in the life of an ALM Developer: Write new code for a user story.

You specify all the work item types that you use to track bugs in the definition for the Bug Category, and you assign metatstates to workflow states in the definition for ProcessConfiguration. Changes that you make to the definition files apply for all teams that work in the team project that you customize.

Note

This customization is only valid for team projects that are based on the process templates for Microsoft Solutions Framework (MSF) Agile or Capability Maturity Model Integration (CMMI).

Requirements

  • To access My Work, you must have Visual Studio Premium or Visual Studio Ultimate installed.

  • To run the witadmin command-line tool, you must be a member of the Team Foundation Administrators group or a member of the Project Administrators group for the team project. For more information, see Permission reference for Team Foundation Server.

Default metastate assignments made to workflow states for bugs

The following table lists the default metastates assigned to the bug workflow states for the TFS Agile and CMMI process templates. You only need to assign a metastate to a workflow state that you want to show up on the task board or for My Work to recognize. The default assignments include the typical workflow progression from Active or Proposed to Closed. If your bugs contain workflow states outside this progression, such as a Removed state, then you exclude those states in your metastate assignments.

MSF for Agile Software Development

MSF for CMMI Process Improvement

<BugWorkItems category="Microsoft.BugCategory">
   <States>
      <State value="Active" type="InProgress" />
      <State value="Resolved" type="Resolved" />
      <State value="Closed" type="Complete" />
   </States> 
</BugWorkItems>
<BugWorkItems category="Microsoft.BugCategory">
   <States>
      <State value="Proposed" type="Proposed" />
      <State value="Active" type="InProgress" />
      <State value="Resolved" type="Resolved" />
      <State value="Closed" type="Complete" />
   </States> 
</BugWorkItems>

Back to top

Add types of work items to the Bug Category

You add types of work items to a category by updating the categories definition file and importing it for your team project.

  1. To run the witadmin command-line tool, open a Command Prompt window where either Visual Studio or Team Explorer is installed and enter:

    cd %programfiles%\Microsoft Visual Studio 12.0\Common7\IDE
    

    On a 64-bit edition of Windows, replace %programfiles% with %programfiles(x86)%.

  2. Type the following command, and substitute your data for the arguments that are shown here, where CollectionURL specifies the URL of a team project collection, ProjectName specifies the name of a team project defined within the collection, and DirectoryPath specifies the name and location for the file to export. Then choose Enter.

    witadmin exportcategories /collection:CollectionURL /p:ProjectName /f:"DirectoryPath\categories.xml"
    
  3. Open the categories file in Notepad and locate the CATEGORY element for the "Bug Category".

  4. To add a new type of work item, add a WORKITEMTYPE element that specifies the reference name of a work item type that you want to add.

    For example, the following syntax adds the work item type of "Performance Bug" to the bug category.

    <CATEGORY name="Bug Category" refname="Microsoft.BugCategory">
       <DEFAULTWORKITEMTYPE name="Bug" />
       <WORKITEMTYPE name="Performance Bug" />
    </CATEGORY>
    
  5. Type the following command to import the definition file:

    witadmin importcategories /collection:CollectionURL /p:ProjectName /f:"DirectoryPath\categories.xml"
    

For more information, see Use categories to group work item types.

Back to top

Assign metastates to workflow states defined for bugs

You assign metastates to the workflow states of bugs within the BugWorkItems element in the definition for ProcessConfiguration.

  1. From the Command Prompt window for witadmin, type the following command and substitute your data for the arguments that are shown here, where CollectionURL specifies the URL of a team project collection, ProjectName specifies the name of a team project defined within the collection, and DirectoryPath specifies the name and location for the file to export. Then choose Enter.

    witadmin exportprocessconfig /collection:CollectionURL /p:ProjectName /f:"DirectoryPath\ProcessConfiguration.xml"
    
  2. Open ProcessConfigurations in Notepad and locate the BugWorkItems element.

  3. Update the values assigned to the State elements to match the values used in the workflow for the types of work items that you use to track bugs.

  4. (Optional) To add another state that is present within the workflow, specify another State element that maps to the workflow state of the work item type included within the Bug Category.

    For example, the following syntax adds the state value of "Investigating", to "inProgress".

    <BugWorkItems category="Microsoft.BugCategory">
       <States>
          <State value="Active" type="InProgress" />
          <State value="Investigating" type="InProgress" />
          <State value="Resolved" type="Resolved" />
          <State value="Closed" type="Complete" />
       </States>
    </BugWorkItems>
    

    Important

    You must specify a value for the State element that corresponds to a valid workflow state. A valid workflow state is one that has been defined for a work item type that is included in Bug Category for your team project. Also, you must assign a metastate type within the Agile or Bug group, that is Proposed, InProgress, Resolved, or Complete.

  5. Import the definition file:

    witadmin importprocessconfig /collection:CollectionURL /p:ProjectName /f:"DirectoryPath\ProcessConfiguration.xml"
    

Back to top

See Also

Concepts

Process configuration XML element reference