When SUMming measures, they often double count issues that have moved projects. Is there a way to avoid this? In short, I want the count, not the sum, but that seems to fundamentally change the way I need to write the custom measures. Here’s an example where I am interested in knowing the total number of epics for a given Fix Version:
However, when you Drill through issue, you can see that the count is overstated, in this case by one; again, this is due to the epic moving projects:
Here is the formula for Epic Count:
Sum(
filter(
Descendants([Issue].CurrentMember, [Issue].[Issue]),
[Measures].[Issue type] = "Epic"
AND
[Measures].[Issue ACCOPS Work] > 0
),
[Epic Fix Version].CurrentHierarchyMember
)
The measure Issue ACCOPS Work is created on import and not always used (meaning, the double counting of moved issues affects many different calculations). That said, here’s the code for it (in Advanced Settings), just in case:
[jira.customfield_eazybiaccopswork]
name = "ACCOPS Work"
data_type = "integer"
measure = true
javascript_code = '''
var projectComponent = "Account Operations";
var projectKey = "ACCOPS";
var result = null;
if (issue.fields.project.key == projectKey) {
result = 1;
} else if (issue.fields.components.forEach(function(component) {
if (projectComponent.indexOf(component.name)>=0) {
result = 1;
}
}));
if (result) {
issue.fields.customfield_eazybiaccopswork = result;
}
'''
Any help would be greatly appreciated.