Count test cases having several labels in them

We have Jira with Zephyr Scale. Thousands of test cases with different labels on them.

Now I need an eazyBI report to count how many test cases have a specific subset of labels on them. I see how to count every single label mentioned in test cases, but miss how to distinguish intersection of sets Label A + Label B + Label C.

Obviously I am missing something simple, please advise.

Hi @MikePerk,

When filtering by multiple labels in eazyBI, the default behavior treats them as an OR condition—meaning it will show test cases with any selected labels. This happens because Label is a multi-value field, and values are not related to each other.

You’ll need to create a calculated measure to count test cases with a specific combination of labels (AND condition). The idea is to iterate through individual test cases and check each Label.

For example, you can hardcode the labels in the calculation like this:

NonZero(Count(
  Filter(
    -- get all test cases
    Descendants([Zephyr Scale Test Case].CurrentMember, [Zephyr Scale Test Case].[Test Case]),
    -- check if test case has all three labels
    ([Measures].[Zephyr Scale Test Cases created],
    [Zephyr Scale Test Case Label].[label A]) > 0
    AND
    ([Measures].[Zephyr Scale Test Cases created],
    [Zephyr Scale Test Case Label].[label B]) > 0
    AND
    ([Measures].[Zephyr Scale Test Cases created],
    [Zephyr Scale Test Case Label].[label C]) > 0
  )
))

Another example if you have the “Zephyr Scale Test Case Label” dimension on pages and filter by multiple labels:

NonZero(Count(
  Filter(
    -- get all test cases
    Descendants([Zephyr Scale Test Case].CurrentMember, [Zephyr Scale Test Case].[Test Case]),
    -- check if test case has all selected labels on page filter
    ([Measures].[Zephyr Scale Test Cases created],
    [Zephyr Scale Test Case Label].CurrentHierarchyMember) 
    =
    --count of selected labels
    Count(
      ChildrenSet([Zephyr Scale Test Case Label].CurrentHierarchyMember)
    )
  )
))

More details on calculated measures are here: Calculated measures.

Best,
Zane / support@eazyBI.com

Thank you a lot, Zane! It works as needed.

1 Like