Count the resolved issues which have specific string in summary

I have a user defined measure to calculate hours spent on specific issues which contain a particular string on summary, and it works. However, when I use that same code to just modify to count the resolved issue, it returns nothing.
Here is the workable one for hours spent:
Aggregate(
Filter(
Descendants([Issue].CurrentMember, [Issue].[Issue]),
[Issue].CurrentHierarchyMember.Name MATCHES “.project support.” OR
[Issue].CurrentHierarchyMember.Name MATCHES “.Project Space, Service and Support.*”
), [Measures].[Hours spent with sub-tasks]
)

And here is the one that not working:
Aggregate(
Filter(
Descendants([Issue].CurrentMember, [Issue].[Issue]),
[Issue].CurrentHierarchyMember.Name MATCHES “.project support.
),

[Measures].[Issues resolved]
)

Could not figure out what is wrong.
Screenshot to show the one work while other not:
image

Could someone please help?
Thank you

Hi @HungKieu,
First, you should check if your MATCHES expression is correct and returns any result. In the first calculation, you have two MATCHES and it could be that the first one doesn’t return any result?
See related regular expression documentation page: Regular expressions

But the measure you have created could impact your report performance as it iterates through all issues and thus is not recommended. A better solution would be to create a JavaScript calculated field that returns results during the import. And then use this dimension for further calculations by using a tuple with the needed measure.

Following is an answer to a similar question that could work also in your use case:

After importing this dimension, you can use it to create a tuple with the measure “Hours spent with subtasks” and second with “Issues resolved”:

([Measures].[Hours spent with sub-tasks], [Issue summary Developer].[true])

([Measures].[Issues resolved], [Issue summary Developer].[true])

best,
Gerda // support@eazyBI.com

Hi @gerda.grantina ,
I’ve created a new measure using JavaScript calculated customer fields as your suggestion. It not yet solved my request but seemed closer to what I’m looking for.
The context is: I need to count the concurrent projects in a given time an admin worked on (per week).
I supposed to count the number projects a given admin worked on by determine which project that he had issue with his time spent on, then I can do a SUM to determine how many projects he worked on concurrently at that given time.
As long as admin A spent time in issue Y under project X, in the week Z => I will count A has 1 project in week Z. Ultimately, I will SUM all of them to calculate how many projects in total for A in the week Z he worked on.
Here is the code I used:
[jira.customfield_count_issue_notnull]
name = “count issue”
data_type = “integer”
measure = true
javascript_code = ‘’’
var result;
if (issue.fields.timespent) {
result = 1;
} else {
result = 0;
}
issue.fields.customfield_count_issue_notnull = result;
‘’’

Problems are:

  • this code counts the issue with timespent >0 in its lifetime, whereas I only want to count issue by 1 in particular weeks that given admin spent time on. Otherwise, it should return 0.
  • This code counts all the issues with timespent >0 in a project, whereas I only wanted to count the number of project actually. Example: if admin A worked on 3 issues in project X => this will count as 3, but actually I only wanted to count as 1 project.
    (I don’t know how to solve this in code, as I am not a JavaScript developer)
    Could you please help?
    Thanks

Hi @HungKieu ,
For that scenario, you don’t need to create a JavaScript calculated field.

You can use a hidden measure in eazyBI “Issues with hours spent” and create new calculated measure in Measure dimension using this formula:

NonZero(
  Count(
    Filter(
      Descendants(
      [Project].CurrentMember,[Project].[Project]),
      [Measures].[Issues with hours spent]>0
    )
  )
)

In the report it looks like this:

best,
Gerda // support@eazyBI.com

Hi @gerda.grantina ,

I’m not sure if this is performance risk? I tried with the new measure using your formula but it it’s pending for a while without return the resukt yet.