[Mesure Problem] Xray Test Count by Last Execution Status in Test Plan

Hi ,
I already select noempty and a single test plan but i cant get the number by status

Please Help

Measure Script:

CASE WHEN
[Xray Test Execution Status].CurrentMember.Level.Name = “Status”
THEN --count tests by last execution status
Cache(NonZero(Count(
Filter(
–iterate throug all Tests
Descendants([Xray Test].CurrentMember, [Xray Test].[Test]),
[Measures].[Xray Tests with executions] > 0 AND
Order(
–iterate through execution statuses for a selected Test
Filter([Xray Test Execution Status].[Status].Members,
[Measures].[Xray Tests with executions] > 0),
–order statuses by execution date descending
DateParse(
Generate(
Tail(
–iterate through all dates when a Test was executed
Filter([Time].[Day].Members,
[Measures].[Xray Tests with executions] > 0
)).Item(0),
Format([Time].CurrentHierarchyMember.StartDate, ‘yyyy-mm-dd’),
“,”)),
BDESC
–name of the last execution matches status in columns
).item(0) IS [Xray Test Execution Status].CurrentMember)
)))
ELSE --total count of tests with executions
([Measures].[Xray Tests with executions],
[Xray Test Execution Status].DefaultMember)
END

no one to help ?
Is really critical

Any newwwwwwwwwwwwwwws ???

Hi @nour,

The calculation for the last execution status within the report context (selected test plan, environment, fix version, or some other criteria) is complex. It takes a lot of resources to run through all tests and execution results and compare them. Unfortunately, for more significant data amounts, this might end with a timeout.

Here is another version (a somewhat faster) of how to calculate the last execution within a selected Test Plan, Environment, or some other criteria:

CASE WHEN
  [Xray Test Execution Status].CurrentMember.Level.Name = "Status"
THEN
  Cache(NonZero(Count(
    Filter(
      --iterate through Tests
      Descendants([Xray Test].CurrentMember, [Xray Test].[Test]),
      [Measures].[Xray Tests with executions] > 0 AND
      Order(
        --iterate through execution statuses for a selected Test
        Filter([Xray Test Execution Status].[Status].Members,
          [Measures].[Xray Tests with executions] > 0),
        --order statuses by execution date descending
        [Measures].[Xray Tests executed last date],
        BDESC
        --name of the last execution matches status in columns
      ).item(0) IS [Xray Test Execution Status].CurrentMember
  ))))   
ELSE --total count of tests with executions
  ([Measures].[Xray Tests with executions],
  [Xray Test Execution Status].DefaultMember)
END

Related Community topic:

An alternative is to import the last execution status for each Test and Test Plan combination using additional data import. The structure for additional data source might look like this:

  • Test - key of each test case to map additional data to the “Xray Test” dimension. Mark advanced options “Key column” and “Skip missing”.

  • Test plan - key of the test plan to map additional data to the “Xray Test Plan” dimension. Mark advanced options “Key column” and “Skip missing”.

  • Test execution status - the last execution status in a test plan to map additional data to the “Xray Test Execution Status” dimension. Mark advanced options “Key column” and “Skip missing”.

  • Time - the date when the test was executed for the last time for a Test Plan to map additional data to the Time dimension. This column is optional if you use the “Time” dimension in the report.

  • Counter - number 1 to count unique test and test plan and status combinations. Import this column as a new measure “Tests by last execution status in a Test Plan.”

More details on additional data import: Additional data import into Jira Issues cube - eazyBI for Jira

Best,
Zane / support@eazyBI.com