Filtering on Program Increment at Epic Link level

I am trying to build a report which would display issue details from Measures and are Epics.
Instead of selecting 50 Epics as filter, I would like to write a calculated field to return all Epics which has Program Increment as a . We populate the PI Value in Program Increment field on Epic.

Pages - Epic Link
Rows - Epic Link
Aggregate(
Filter(
[Epic Link].[Epic].Members,
Generate(
Filter(
[Program Increment].[Program Increment].Members,
([Measures].[Issues created],[Issue].[Issue].getMemberByKey([Epic Link].CurrentMember.key),
[Epic Link].DefaultMember) > 0),[Program Increment].[Program Increment].Name) MATCHES “PI 20.8.5”

)
)

This is what I modified from a filter on Label report. Any help is appreciated.

Hi @sanjeevnarula,

The most convenient approach to filter Stories by Epic fields is by useing issue linked field dimensions , like Epic Label, Epic Fix Version, and other. There are more details, how to create those dimensions: https://docs.eazybi.com/eazybijira/data-import/advanced-data-import-options/issue-link-field-dimensions.

Such linked field dimension could be create also for other Epic fields as long as field is a single-select custom field. In that case, you may define a new JavaScript calculated custom field that would return custom field value and pass it down to epic child issues. There are more details on JavaScitp calculated custom fields and how tot est them beforehand: https://docs.eazybi.com/eazybijira/data-import/custom-fields/javascript-calculated-custom-fields
The structure for JavaScript calculated custom file might look like this, where NNNNN is custom field ID in Jira:

[jira.customfield_NNNNN_e]
name = "Epic Custom field"
data_type = "string"
dimension = true
update_from_issue_key = "epic_key"
javascript_code = '''
if(issue.fields.customfield_NNNNN && issue.fields.customfield_NNNNN.value) {
  issue.fields.customfield_NNNNN_e = issue.fields.customfield_NNNNN.value;
}
'''

, where NNNNN is a custom field ID in Jira.

If there is no option to create a linked field dimension or JavaScript calculated custom field, you may define a new calculated measure for the report. The calculated measure would go through all issues and change the context of the custom field dimension, in your case, “Program Increment”.
The formula for calcaulted measure that counts created issues by "Progrma Increment: of linked epic might look like this:

--annotations.drill_through_non_empty=false
Nonzero(Count(
  --set of issues
  Filter(
    --go throug all issues ignoring assigned Program Increment
    Descendants([Issue].CurrentMember,[Issue].[Issue]),
    ([Measures].[Issues created],
    [Program Increment].CurrentHierarchy.DefaultMember) > 0 AND
    --get the Program Increment value of linked Epic
    DefaultContext((
       [Measures].[Issues created],
       [Program Increment].CurrentHierarchyMember,
       [Issue.Epic].[Epic].GetMemberbyKey([Issue].CurrentHierarchyMember.get('Epic Link')),
       [Issue Type].[Epic]
    )) > 0
  )
))

Best,
Zane / support@eazyBI.com

Hello @zane.baranovska I was looking at the final option you provided, and if I understood correctly this will apply a filter to this measure based on what we use on the Pages, correct?

How will this behave if we don’t have the “Program Increment” filter? And what about if we want to add another filter like an “Agile Release Train” for example?

Pedro, I tried to answer to your last question in another thread: Filter by Epic Link Property - #4 by ilze.leite

llze