Share via


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

  • Prerequisites

  • Your Team Project in Team Explorer

  • Adding Work Items

  • Viewing Work Items

  • Finding Work Items

    • Creating a Simple Work Item Query

    • Adding Fields to and Sorting Query Results

    • Grouping Query Clauses

  • Saving a Query

  • E-mailing a Link to a Query

Note

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

Required Permissions

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.

Prerequisites

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

Your Team Project in Team Explorer

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:

  • Work Items   Includes the team project Team Queries and My Queries, which are described later in this topic.

  • Documents   Supports document sharing and includes the documents that were uploaded during project creation. This node is present only if your team project has been configured with a project portal that is based on SharePoint Products.

  • Reports   Supports sharing of reports and includes the reports that were uploaded during project creation. This node is present only if your team project has been configured with SQL Server Reporting Services.

  • Builds   Provides access to the build features in Team Foundation.

  • Source Control   Provides access to version control features in Team Foundation.

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.

Team Explorer nodes

Adding Work Items

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

  1. In Team Explorer, expand your team project node.

  2. Right-click the Work Items folder, point to Add Work Item, and then click Bug.

  3. In the Title field, type Test Bug.

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

  5. On the form toolbar, click Save 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.

Viewing Work Items

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

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

  2. Double-click the My Bugs query to search for any bugs that are assigned to you.

  3. Double-click the My Tasks query to search for any tasks that are assigned to you.

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

  1. On the Team menu, click Go To Work Item.

  2. In the Go to Work Item dialog box, type the ID number.

  3. Click OK to open the work item.

Finding Work Items

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.

Warning

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

  1. From the Team Queries folder in the Work Items node, click the Iteration 1 folder.

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

  1. In the Work Items node, right-click the My Queries node, and then click Add Query.

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

    Note

    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.

  3. On the query view toolbar, click Run.

    The results appear in the Query Results list.

  4. On the toolbar, click Save Save Query.

  5. In the Save Query As dialog box, under Name, type MyQuery1.

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

  1. In the Query View toolbar, click Column Options.

  2. In the Column Options dialog box, select the Fields tab.

  3. Under Available columns, select Work Item Type.

    Note

    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.

  4. Click > to copy the selection to Selected columns.

    Note

    To remove any columns in the query results list, select the column name under Selected columns, and then click <.

    Note

    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.

  5. Click OK to save the options, and view the selected column for the query results.

To sort the Query Results List

  1. In the Query View toolbar, click Column Options.

  2. In the Column Options dialog box, click the Sorting tab.

  3. Under Available Columns, select the column Work Item Type.

  4. Click > to move the selection to Selected Column.

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

  6. In the Selected columns box, select a column, and then click the ascending or descending icons to control the sort direction.

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

  1. Select the last two query clauses in the query that you created previously.

  2. On the query toolbar, click Group Query Clause (Group Clauses).

    A bracket that resembles a parenthesis surrounds the two rows.

Saving a Query

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

  1. Create a query.

  2. On the query toolbar, click Save Save Query.

  3. In the Save Query As dialog box, under Name, type a name for your query.

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

  5. Click Save.

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

See Also

Concepts

Team Queries (CMMI)

Other Resources

Team Queries (Agile)

Work Items and Workflow (Agile)

Work Items and Workflow (CMMI)

Managing Team Foundation Work Items

Querying for Work Items

Walkthrough: Adding Links to Work Items