Filter/View

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

OVERVIEW

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

CREATE 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 OB.id From OBJECTS OB  inner join OBJECTS_VER_VIEW OVS ON OB.ID=OVS.ID and V.view_version= v.view_version
where OB.id 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 LIST  MULTIPLE WORKITEMS INTO THE SAME EMBED FILTER

The child items listed under the folder may have different work item types. Therefore, we need to follow these steps to include them in the embedded filter result:

  • Click on the Source icon from the Description toolbar and search for the embed filter
  • Update the obj-type to include multiple work item code separated by commas

 obj-type=”DOC,ACTION_ITEM,DMS”

The Code used here should be the Work Item code and not the custom Code

Save the description.

All mentioned work items will be listed in the same embed filter in the item’s description.

RELATED LINKS

How to create View

Related Articles