Get sub-task assignee based on sub-task summary

Hi, I am able to get all the sub-task assignee name and their summary with this code:
CASE WHEN NOT
– Sub-task keys property stores max 255 charters
(IsEmpty([Issue].CurrentHierarchyMember.get(‘Sub-task keys’)))
THEN
– generate all sub-task keys list from Sub-task hierarchy
Generate([Issue.Sub-task].[Parent].getMemberByKey([Issue].CurrentHierarchyMember.Key).Children
,[Issue.Sub-task].CurrentHierarchyMember.GetString(‘IssueSummary’)
||" " ||
[Assignee].[User].getMemberNameByKey([Issue.Sub-task].CurrentHierarchyMember.get(‘Assignee name’)
)
, ‘,’)
END

My next step is to get the first assignee name whose sub-task is “testing” or “test” (case should not be senstive). Could you please guide me with the filter code? Thanks.

Hi @Vu_Tran

You can try this formula to filter the set of children and return the earliest (by created date) sub-task that has “testing” or “test” substring in issue summary and has the assignee.

CASE WHEN NOT
--Sub-task keys property stores max 255 charters
(IsEmpty([Issue].CurrentHierarchyMember.get('Sub-task keys')))
THEN
--generate all sub-task keys list from Sub-task hierarchy
Generate(
  Order(
  Filter(
  [Issue.Sub-task].[Parent].getMemberByKey(
    [Issue].CurrentHierarchyMember.Key
  ).Children,
  
  (
  [Issue.Sub-task].CurrentHierarchyMember.GetString('IssueSummary') matches ".*(?i)testing.*"
  OR 
  [Issue.Sub-task].CurrentHierarchyMember.GetString('IssueSummary') matches ".*(?i)test.*"
  )
  AND
  Not IsEmpty([Measures].[Issue assignee])
  ),
  [Issue.Sub-task].CurrentHierarchyMember.get('Created at'),
  BASC
  ).item(0)
  ,
  [Issue.Sub-task].CurrentHierarchyMember.GetString('IssueSummary')
  ||" " ||
  [Assignee].[User].getMemberNameByKey(
    [Issue.Sub-task].CurrentHierarchyMember.get('Assignee name')
  ),
  ','
)
END

Martins / eazyBI support

1 Like

Thanks @martins.vanags , it works!!!