Get child work items for a specific parent in TFS

2019-07-22 23:41发布

How to get child work items for a specific parent in TFS? I need a Flat List which takes a parent ID as a query parameter and returns the child work items.

Note: Till now I'm able to to do this only with the 'Work Items and Direct Links' query.

标签: tfs
2条回答
做个烂人
2楼-- · 2019-07-23 00:38

We cannot achieve that by "Flat list of work items" query as there ins't the fields/condition to query that, we can use "Tree of work items":

  1. Select "Tree of work items"
  2. Set up the query for the top level work items, "User Story" with id 105 for example here (See below screenshot, just specify the Parent work item ID here).
  3. Under "Filters for linked work items" you can exclude descendent items, or specify the Child work item types, for example only show Task and Bug, just set Work Item Type in Task,Bug, or leave it as [Any], it will returns all the types of child work items for the specific Parent.
  4. Filter options : Match top-level work items first, Type of tree : Parent/Child

enter image description here

查看更多
地球回转人心会变
3楼-- · 2019-07-23 00:42

You can custom widget to get work items by using WorkItemTrackingHttpClient (e.g. queryById()), then display the result what you want.

About custom dashboard widget: Add a dashboard widget.

There are many extension samples that can help you: vsts-extension-samples

查看更多
登录 后发表回答