简体   繁体   中英

How do I use and & or in a TFS 2010 query

I have created the following query:

AndOr Field           Operator   Value
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
      Team Project    =          @Project
And   Area Path       Under      MyProject 
And   Iteration Path  Under      MyProject\Iteration 5
And   Work Item Type  =          User Story
Or    Work Item Type  =          Task

After I run the query, I see all the workitems in the results, even if they are under Iteration 4, Iteration3, etc.

I only expected to see all User Story and Task items under MyProject\\Iteration5.

The way I added my Iteration 5 was to go to Areas and Iterations and creating it. Any help is highly appreciated.

In order to only see the user stories and tasks you will need to group these clauses together in the query editor.

From within the Visual Studio IDE, edit your query, ensure the two lines refering to work item type are adjacent to each other and last in the list of clauses eg

  • 1 Team Project = @Project
  • 2 And Iteration Under \\MyIteration
  • 3 And Work Item Type = User Story
  • 4 Or Work Item Type = Task

Highlight both the Work Item Type clauses (items 3 and 4) and right click and select 'Group Clauses'. Execute your query.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM