How to filter Child Nodes under a Folder in the Product tree


In some cases, you may wish to list out the child items under the selected node in the Product Tree. To do so, we need to add the query in our filter


  1. Filter with Projects=Project A and Item Type = Any Item
  2. User defined Criteria: (Path like ((Select Path from OBJECTS Where ID=[$ME]) + (Select max(cast(Original_id as varchar)) from OBJECTS_VER_VIEW Where ID=[$ME]) + ‘\%’) or ID=[$ME])

    Note: In the Work Item Grid, you will see all the Items

  3. Embed the View in the Item Description

Now, you will see only the Child items data

For Example: Consider the Parent Node A with 3 child nodes Child 1, Child 2, Child 3

Embed the above filter in Parent Node A’s Description, now you will find the data related to Child 1, Child 2, Child 3 only

In case Child Nodes include copy as link items also:

Use the user defined criteria: ((  path like (select path + cast((select distinct original_id from objects_ver_view where id=[$ME]) as varchar) + ‘\%’ from objects where id=[$ME] and action_type<>’LINK’) or id=[$ME]
OR  (id in ( SELECT distinct From OBJECTS OB  inner join OBJECTS_VER_VIEW OVS ON OB.ID=OVS.ID and V.view_version= v.view_version
where in (select * from [dbo].[fnGetAllChildren]([$ME],v.view_version))  AND OVS.Action_type=’LINK’ and V.Parent_original_id in  (select * from [dbo].[fnGetAllChildren]([$ME],v.view_version)) ))  ))

Make sure to replace single quotes manually in query in case we get the syntax error on Save Filter


How to create View

Related Articles