Custom field as a filter doesn't return all necessary results

Hi everyone!

Could you please help me with the following:

Current Setup:
There is the “OKR” custom field with the list of predefined options (“FY25Q1”, “FY25Q2”, etc.). The field can be populated on the different levels:

  • On the epic
  • On the Story that doesn’t have an epic

The idea is to use the “OKR” field as a filter with a specific value selected in the eazyBI report to return all needed tickets:

  • All epics and their child issues
  • All tickets without epics if the OKR value matches the filter

Problem:
Currently, if the value is selected in the OKR filter it returns only the tickets with that value or the epics without child issues if the value is selected only on the epic itself. However, it doesn’t show up the epic’s child issues if the value is selected only on the epic level.

So I have created another custom field in the advanced settings:

[jira.customfield_10501_e]
name = "OKR_epic" 
data_type = "string"
update_from_issue_key = "epic_key"
issue_type = ["Epic", "Parent", "Sub-task"]
javascript_code = '''
if(issue.fields.customfield_10501) {
   issue.fields.customfield_10501_e = issue.fields.customfield_10501;
}
'''

This field inherits the OKR value from the epic to child issues. Now there is a different issue - when we use this field as a filter it returns the epics with matched value along with the child issues BUT it doesn’t return the tickets without epics if they have the OKR that matches the filter.

Please see the filter results below:

Goal:
The goal I am trying to achieve is to show all tickets that matches the selected OKR in the filter:

  • Tickets without the epic if the OKR is specified on the ticket
  • Epics with child issues if the OKR is specified only on the epic

Solutions that didn’t work:

Solution 1
I created another custom field in the advanced settings as follows:

[jira.customfield_10501_all]
name = "OKR Timeline"
data_type = "string"
dimension = true
javascript_code = '''
if(issue.fields.customfield_10501_e == "" || issue.fields.customfield_10501_e == "(none)") 
{ issue.fields.customfield_10501_all = issue.fields.customfield_10501;
}
else {issue.fields.customfield_10501_all = issue.fields.customfield_10501_e}
'''

But it didn’t work. It seems like it can’t take the value from another custom field defined in the advanced settings.

Solution 2
I created a calculated measure as follows:

CASE
WHEN
Not IsEmpty ([Measures].[Issue Epic Link])
THEN [Issue].[Issue].GetMemberbyKey([Measures].[Issue Epic Link]).get('OKR_epic')
ELSE [Measures].[Issue OKR]
END

It shows up the proper result but I need it as a dimension to be able to use it as a filter with the list of available options. So unfortunately, it doesn’t work for me either.

Could you please help me to resolve the issue and achieve the goal to show up all of the needed tickets (with and without the epic) with the selected OKR value? I would really appreciate any help. Thanks!

Hi,

The solution 2 is on the right track. You can extend the formula so it will work as the filter depending on what OKR is selected in the report pages.

CASE WHEN
 CASE WHEN Not IsEmpty ([Measures].[Issue Epic Link])
   THEN [Issue].[Issue].GetMemberbyKey([Measures].[Issue Epic Link]).get('OKR_epic')
   ELSE [Measures].[Issue OKR]
 END=[OKR].CurrentMember.Name
THEN 1
END

Once you put the row filter on this measure, it should work as expected for your use case:

Kindly,
Janis, eazyBI support

Hi Janis! Thanks for your response. Since we need to have the OKR as a filter in the report we decided to go with another solution and set up Jira automation rules to copy the value to all child issues under the epic.

1 Like