Sum of open Blocker Defects

Hello there,
I want to create an eazBI report where I can see both the test and defect status. This report is not based on the test executions, but on a custom field for business processes (“Geschäftsprozess”) which is imported as dimension.

I can already report the executed tests for an business process by status. Here the example for the TestRunStatus PASS:

Sum(
Filter(
Descendants([Xray Test].CurrentHierarchyMember, [Xray Test].[Test]),
[Measures].[Xray Tests created]>0 and [Xray Test].CurrentHierarchyMember.get(‘Testlaufstatus’)=“PASS”
),
(
[Measures].[Xray Tests with executions],
[Geschäftsprozess].DefaultMember
)
)

Now I need a measure for open defects and priority. I tried it like this, but this is not right and creates an error:

Sum(
Filter(
Descendants([Xray Defect].CurrentHierarchyMember, [Xray Defect].[Defect]),
[Measures].[Xray Defect created]>0 and [Xray Defect].CurrentHierarchyMember.get(‘Priority’)=“Blocker” and [Xray Defect].CurrentHierarchyMember.get(‘Status’)<>“Closed”
),
(
[Measures].[Xray Defect created],
[Geschäftsprozess].DefaultMember
)
)

Can anybody help me?

Thanks,
Monique

Hi @Monique
Welcome to the eazyBI community!

The error could be raised, most probably, because there are no such measure “[Measures].[Xray Defect created]”, unless you have imported your custom calculated custom field “Xray Defect” (outside the XRay standard integration) or this is your custom calculation.
You may consider using measure “Xray Tests defect count” instead. Read more about available XRay measures: https://docs.eazybi.com/eazybijira/data-import/data-from-jira-and-apps/xray-test-management#XrayTestManagement-XrayMeasures

Additionally, for issues as well as issue based dimensions, the imported property is Priority ID, not the priority name; the name should be retrieved by the ID (as it is done in measure “Issue priority”). You may want to to retrieve the defect priority in the following way:

    [Priority].[Priority].getMemberNameByKey(
  [Xray Defect].CurrentHierarchyMember.get('Priority ID')
)

The same goes for defect Status; in case of status, you may use already calculated property from Measures “Xray Defect status”.

Third, when you compare two strings (priority name and status), use operands MATCHES and NOT MATCHES. When comparing strings, it is good to ensure that you always got non-empty string even if there are no value - for that, use CoalesceEmpty function.

Also, I suspect that the first filter condition also should be the tuple

(
[Measures].[Xray Defect created],
[Geschäftsprozess].DefaultMember
)

So, the final calculation, from my point of view, would be the following:

Sum(
Filter(
 Descendants([Xray Defect].CurrentHierarchyMember, [Xray Defect].[Defect]),
 ([Measures].[Xray Tests defect count],
 [Geschäftsprozess].DefaultMember)>0  
 AND
 CoalesceEmpty([Priority].[Priority].getMemberNameByKey(
  [Xray Defect].CurrentHierarchyMember.get('Priority ID')
  ), "") MATCHES "High"
 AND
 CoalesceEmpty([Measures].[Xray Defect status], "") NOT MATCHES "Closed"
 ),
([Measures].[Xray Tests defect count],
 [Geschäftsprozess].DefaultMember))

Best,
Ilze / support@eazybi.com

1 Like

Hello Ilze,
thank you for the response. We tried it, but now we get for all items of “Geschäftsprozess” the same value.
Bild1
Do you have any idea, why it is like that?
Thanks,
Monique