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

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 Run 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 Run 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 Run Status].CurrentMember
      ))))   
    ELSE --total count of tests with executions
      ([Measures].[Xray Tests with executions],
      [Xray Test Run 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 “Issue” dimension (“Xray Test Plan” dimension is not available for additional data import, and the workaround is to use the “Issue” dimension that also holds Test Plan issues). 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

Best,
Zane / support@eazyBI.com