Sum of bugs linked to story per time/user

Hi EazyBi support,

I use the following custom field and calculated member to count number of linked bugs raised for story on UAT/QA env.

Bugs under Issue
[jira.customfield_BugIssue]
name = “Linked Bugs”
inward_link = “have bug”
issue_type = “Bug”
multiple_values = true
dimension = true

Case
When
[Issue].CurrentMember.Level.Name = “Issue”
AND
[Linked Bugs].Currentmember is [Linked Bugs].Defaultmember
Then
– retrieve Bugs information from Issue property Bugs
Count(
Filter(
[Issue].CurrentHierarchy.GetLinkedmembers(‘Linked Bugs’),
CoalesceEmpty([Measures].[Issue Type of Environment],‘A’) MATCHES ‘QA|UAT’)
)
Else
– total calculation for any issue, data on Bugs level
CoalesceEmpty(Sum(
Filter(
Descendants([Linked Bugs].Currentmember, [Linked Bugs].[Linked Bugs]),
CoalesceEmpty([Linked Bugs].CurrentMember.Get(‘Type of Environment’),‘A’) MATCHES ‘QA|UAT’),
[Measures].[Issues created]),0)
End

It works fine for stories per Group Leader:

But it doesn’t work properly when I add Time dimension:

I would like to count all Bugs linked to Stories resolved in the specific period of time (i.e. last 3 months), no matter when the bug was created/resolved.

Can you help me please :)?

Hi @Izzy,

The page filter in the report applies to the measures. In this case - the time when the issues were created, regardless of when the bugs were created or resolved.
The problem with the Time dimension is that the first part of the expression ignores the page filters and returns the number of linked bugs also for the issues that do not comply with the report context.
The measure should only retrieve the number of linked bugs for the issues that comply with the page filters.

The part of the expression that counts the number of linked bugs should only run if the issue complies with the report context.
You might achieve that with a CASE WHEN conditional check construction.

The updated measure might look as follows.

Case
 When
  [Issue].CurrentMember.Level.Name = “Issue”
  AND
  [Linked Bugs].Currentmember is [Linked Bugs].Defaultmember
Then
--first check if the current issue complies with the report context 
 CASE WHEN
--might replace measure with issues resolved if that is the criteria for filtering
  [Measures].[Issues created] >0
 THEN
-- retrieve Bugs information from Issue property Bugs
 Count(
  Filter(
   [Issue].CurrentHierarchy.GetLinkedmembers(‘Linked Bugs’),
   CoalesceEmpty([Measures].[Issue Type of Environment],‘A’) MATCHES ‘QA|UAT’))
END
 Else
-- total calculation for any issue, data on Bugs level
CoalesceEmpty(Sum(
 Filter(
  Descendants([Linked Bugs].Currentmember, [Linked Bugs].[Linked Bugs]),
  CoalesceEmpty([Linked Bugs].CurrentMember.Get(‘Type of Environment’),‘A’) MATCHES ‘QA|UAT’),
--if the filtering condition for the report is issue resolution date - change the measure to the 'issues resolved'
 [Measures].[Issues created]),0)
END

Regards,
Oskars / support@eazyBI.com