Create report on how long a Jira issue resides in a custom field group

Hello there!

I’m trying to solve a problem where I need to report the total time Jira issues spend in certain “groups” until they are resolved. The different groups are pre-defined in a custom field; let’s call it “Resolver Group”. There’s a very limited amount of groups each issue can be in, and an issue can only be in a single group at any given time. I’m quite new to EazyBI and MDX, so my question is:

Is there any recommended way to tackle this problem?

So far, I’ve been creating calculated custom fields using JavaScript, where I go through each issue’s change history and look for any changes to the particular field I’m interested in. It’s quite simple calculations, but I’m not sure I’m taking the best path with this.