Categorize issues based on Zephyr test status

I’m trying to categorize my issues based on the Zephyr test status.

Test Statuses: Pass, Fail, Unexecuted, Blocked, WIP, N/A

Reporting Criteria:
If all test cycles are “Pass”, then categorize as “Pass”
If even 1 test cycle is “Fail”, then categorize as “Fail”
If all test cycles are “Unexecuted”, then categorize as “Unexecuted”
If none of the above criteria, then categorize as “WIP”

An example of a test case that would be categorized as “WIP” is if its 3 test cycles were “Blocked” “Fail” and “Pass”, or “Block” "Unexecuted “Unexecuted”, etc.

At the end, I’d like to get to a pie chart that will report on “Pass” “Fail” “Executed” and “WIP” based on the criteria mentioned above.

Current set-up:

Hi @carriesun,

I understand that you like to put each test in one of the categories PASS, FAIL, UNEXECUTED or WIP based on test execution results over its all test cycles.

In this case, you might want to create a new calculated measure in Measures to do the validation. You have done half of the job by writing down the conditions for each category, and now you can translate those criteria to calculation using condition CASE WHEN / THEN and tuples . For the calculations, you might want to use measure Zephyr Test Execution count to take a look at all test executions. The calculation that returns the category for each test might look like this:

CASE 
WHEN --(1) has at least one failed test execution
  ([Measures].[Zephyr Test Execution count],
  [Zephyr Test Status].[FAIL]) > 0
THEN "FAIL"
WHEN --(2) all execution count matches to passed execution count
  ([Measures].[Zephyr Test Execution count],
  [Zephyr Test Status].[PASS]) = 
  ([Measures].[Zephyr Test Execution count],
  [Zephyr Test Status].DefaultMember) 
THEN "PASS"
WHEN --(3) all execution count matches to unexecuted execution count
  ([Measures].[Zephyr Test Execution count],
  [Zephyr Test Status].[UNEXECUTED]) = 
  ([Measures].[Zephyr Test Execution count],
  [Zephyr Test Status].DefaultMember)
THEN "UNEXECUTED"
ELSE --(4) the rest uf use cases
  "WIP"
END

I will name this calculated measure “Test category” for further references in the report.
Remove dimension Zephyr Test Cycle from the report as calculation above looks for all executions of test and therefore no need to group them by test cycles.

If you would like to get a test count by those categories to build a pie chart, you may define another calculation that goes through all tests one by one and looks for their test category.

NonZero(Count(
  --filter all tests that have been scheduled or execute at least once
  Filter(
    Descendants([Issue].CurrentHierarchyMember,[Issue].[Issue]),
    [Measures].[Issue type] = "Test" AND
    ([Measures].[Zephyr Test Execution count],
    [Zephyr Test Status].DefaultMember) > 0 AND
    --where category name matches status name on columns
    CoalesceEmpty([Measures].[Test categorized],"") MATCHES
      [Zephyr Test Status].CurrentMember.Name
  )
))

Before switching to a pie chart, the report layout might look like this:

Best,
Zane / support@eazyBI.com

1 Like

Quick note that the code in the second part should be updated to match the name given to the measure in the first section.

CoalesceEmpty([Measures].[Test Category],"") MATCHES