Getting Started Tracking Work
This walkthrough demonstrates how you can create work items and track them through a complete project in Visual Studio Application Lifecycle Management (ALM). It shows you how to use the project checklist to make sure key steps are taken during each phase of your project.
After you complete this walkthrough, you will see how easy it is to integrate work items with the rest of your project processes.
In this topic
Saving a Query
This topic is based on the work item types and queries for Microsoft Solutions Framework (MSF) for Agile Software Development v5.0. If your project uses a different process template, your work item types and queries might be different. MSF for Agile Software Development v5.0 is one of the process guidance templates that are included with Team Foundation. For more information, see Artifacts (Agile).
To view or create work items, you must either be a member of the Contributors group or your View work items in this node and Edit work items in this node permissions must be set to Allow. For more information, see Add Users to Team Projects.
To save or modify a team query, you must be assigned or belong to a group that has been assigned Contribute or Full Control permissions for the team query. For more information, see Organize and Set Permissions on Work Item Queries.
An existing Team Foundation Server connection. For more information, see Connect and Access Team Projects in Team Foundation Server
An existing team project. For more information, see Create a Team Project.
One or more Team Foundation users to whom you can assign work items. For more information, see Add Users to Team Projects.
When you start Visual Studio, Team Explorer opens the project in a separate pane that you can dock, as shown in the following illustration.
Every team project includes the following nodes in the team project tree:
In addition to the team project nodes, you will see a My Favorites folder at the top of the list of team projects. You can add shortcuts to the My Favorites folder to quickly access frequently used work items. For more information, see Access Frequently Used or Recently Viewed Work Items, Queries, and Reports.
You track work for a team project by creating and updating work items. Work items move through different states from active to closed as team members address them. If your team project uses the MSF for Agile Software Development v5.0 process template, you have the following types of work items:
User Story A description of the features, functions, and requirements to be implemented to address a user's need or request.
Bug A defect or deviation between expected and observed behavior in the product.
Task A stand-alone action that must be accomplished by a person or group of people.
Issue A known or potential problem, impediment, or risk to a team project.
Test Case A sequence of actions that includes expected results. A test case is used to evaluate whether an application performs correctly.
Shared Steps A group of test steps that can be reused between test cases.
To add a bug work item
In Team Explorer, expand your team project node.
Right-click the Work Items folder, point to Add Work Item, and then click Bug.
In the Title field, type Test Bug.
Complete the form by filling in the fields on the form. To save the work item, you must fill in all required fields.
Required fields are a different color.
On the form toolbar, click Save Work Item.
When you save the bug, Team Foundation assigns it an ID number. This enables you to track it through your project. For reference in another procedure in this walkthrough, note this ID number.
Before you start this walkthrough, you must add several work items and assign different values to the required fields. For example, you must add one bug with a priority of "1" and assign it to yourself. Add another with a priority of "1" and assign it to someone else on the team. Next, add several Tasks and assign them to yourself or other team members. Continue to add 8-10 work items in some combination of the five available work item types. When you have a variety of work item types, you can search for the work items by these differences.
You can open any item from the team project you are currently working in or from other team projects you have added to Team Explorer.
To view all work items assigned to you
After you have created several work items and assigned them to other members of your team, open Team Explorer, expand your team project, expand the Work Items node, and expand the Team Queries node.
Double-click the My Bugs query to search for any bugs that are assigned to you.
Double-click the My Tasks query to search for any tasks that are assigned to you.
Select a work item from the Results List window, and then double-click a work item to open the work item form.
Because work item IDs are unique across all team projects and all work item types, it is easy to find a work item if you already know the ID.
To locate a specific work item
On the Team menu, click Go To Work Item.
In the Go to Work Item dialog box, type the ID number.
Click OK to open the work item.
Use searches, or queries, to locate work items that match specific criteria. The criteria that you specify depend on the information that you need. Each line of a query is called a query clause. If you think of creating a query as you do of asking a question, clauses are the way that you refine your question to get the best possible set of answers.
For best results, add at least one clause to a query before you run it. A query without a clause initiates a search of the whole team project collection. The larger the team project collection, the more time and resources the search takes if you do not specify clauses. A poorly designed query can affect Team Foundation Server performance for the whole team.
To find and run an existing work item query
From the Team Queries folder in the Work Items node, click the Iteration 1 folder.
Double-click the Active Tasks query.
The query appears in Results View with the Query Results on top and the work item form in the lower pane.
Creating a Simple Work Item Query
By using the work items that you just created, you can create a simple query that finds one or more items that meet the criteria.
To create a simple work item query
In the Work Items node, right-click the My Queries node, and then click Add Query.
Add query clauses until you are satisfied that you have the answer that you want. For example, add a clause for Priority = 1, and then add another clause for Activated By = @me (@me automatically inserts your alias).
For more complex queries, test your query by searching a smaller subset of known results. If you have to, you can refine the query before you run it on your whole team project. For example, you could test the query on only those work items that are assigned to you before you run it on those that are assigned to everyone in your group.
On the query view toolbar, click Run.
The results appear in the Query Results list.
On the toolbar, click Save Query.
In the Save Query As dialog box, under Name, type MyQuery1.
Click Save to save the query to your My Queries folder.
Adding Fields to and Sorting Query Results
After you run a query for the first time, you might want to customize the display of your query results.
To change the fields that appear in your Query Results
In the Query View toolbar, click Column Options.
In the Column Options dialog box, select the Fields tab.
Under Available columns, select Work Item Type.
If you want to see more columns, hold down the CTRL key and then click to select more than one column. Column names are listed under Available columns in alphabetical order.
Click > to copy the selection to Selected columns.
To remove any columns in the query results list, select the column name under Selected columns, and then click <.
To change the position of a column in the query results list, select the column, and then click the up or down arrows in the dialog box.
Click OK to save the options, and view the selected column for the query results.
To sort the Query Results List
In the Query View toolbar, click Column Options.
In the Column Options dialog box, click the Sorting tab.
Under Available Columns, select the column Work Item Type.
Click > to move the selection to Selected Column.
In the Selected columns box, select a column, and then click the up or down arrows in the dialog box to control which columns are sorted first.
In the Selected columns box, select a column, and then click the ascending or descending icons to control the sort direction.
Click OK to save the options.
Grouping Query Clauses
When you work with large amounts of data or when you need accurate totals, you should organize the clauses that make up your query in the order that gives you the best possible results.
Add, remove, and move query clauses Test the results as you go. In this manner, most queries are created.
Group clauses Grouping query clauses is like putting parentheses around an expression in a mathematical equation.
To group query clauses
Select the last two query clauses in the query that you created previously.
On the query toolbar, click (Group Clauses).
A bracket that resembles a parenthesis surrounds the two rows.
When you have created a query that retrieves the results that you want, you may want to save it to use later.
To save a query
Create a query.
On the query toolbar, click Save Query.
In the Save Query As dialog box, under Name, type a name for your query.
Under Select the query type and save location, select one of the following options:
To save your query under the Work Items node: Select Server. In the Query folder box, select the team project and folder or subfolder where you want to save your query.
If only you will use the query, save your query in My Queries or in a folder under this node.
If other team members will use the query, save your query in Team Queries or in a folder under this node.
To save your query to a file that you can send in e-mail: Select File, and then enter the folder and file name where you want to save the file. Team Foundation saves the query with the .wiq file name extension.
For more information, see Organize and Set Permissions on Work Item Queries.
To create a hyperlink to query results to display in Team Web Access
(0ptional) To create a hyperlink to a query that accesses the query results that are shown in Team Web Access, you can right-click the tab of the query in Team Explorer, and then click Copy Full Path.
You can e-mail the copied link.