Welcome to Team System Rocks Sign in | Join | Help

Tip: Embedding Queries Within Your Work Items

I stumbled on a way to incorporate work item queries within a work item. In order to do this you must first modify a .wiq file. To obtain a .wiq file, download a process template from the Team Portal using the Process Template Manager (Team > Team Foundation Server Settings > Process Template Manager). Once it has been downloaded, your queries can be found in the MSF for \WorkItem Tracking\Queries directory. Here is a sample of the standard "All Work Items" query (found in AllWorkItems.wiq):

<?xml version="1.0" encoding="utf-8"?>
<WorkItemQuery Version="1">
    <Wiql>SELECT [System.Id], [System.WorkItemType], [System.State], [System.AssignedTo], [System.Title] FROM WorkItems
        WHERE [System.TeamProject] = @Project
        ORDER BY [System.WorkItemType], [System.Id]
    </Wiql>
</WorkItemQuery>

Simply change @Project to the name of the Team Project associated to the work item. For example:

WHERE [System.TeamProject] = "MyTeamProject"

Save your query  file, go into work item tracking, select a work item, click on the File Attachments tab and then attach the .wiq file. The limitation is that if you don't rename @Project to a valid Team Project on your Team Foundation Server you will get an error. To launch the query, open up the work item and double-click on the .wiq file.

One of the uses of this technique is to quickly get to your tasks by scenario. Feel free to post if you have any questions about the technique or any comments. 

Published Sunday, April 23, 2006 3:06 PM by jldavid

Comments

# re: Tip: Embedding Queries Within Your Work Items

Monday, April 24, 2006 7:49 AM by Ben Pryor
Another way to do this is to open the query editor (Add Query), then choose File -> Save As, and select "File" (the third radio button). This will save out the query to a local .wiq file.

# VSTS Links - 04/24/2006

Monday, April 24, 2006 9:56 AM by Team System News
Rob Caron blogs about the accepted Team System BoF sessions at TechEd.  He also tells us about the trouble...
Anonymous comments are disabled