TFS API - How to fetch work item(s) from specific Team Project

后端 未结 2 1218
长情又很酷
长情又很酷 2021-02-01 01:58

I am trying to query a single team project in the main TfsTeamProjectCollection which contains 194 Team Projects in total. I know exactly how to get a WorkIte

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-01 02:49

    It's probably most efficient to use a query to find the workitems you're interested in. You can add a Where project = '@Project' to the query to limit the scope to just that project. By first calling BeginQuery and then EndQuery you'll get a workitem collection for just the items you were looking for.

    The easiest way to get the required wql query is to create a query in Team Explorer, then use file->save as (in edit mode) to save it to file. Open that file in Notepad to copy the query out of there.

    Alternatively you can use the WorkItemStore.Query method directly to achieve the same thing.

提交回复
热议问题