# Count the time spent for stories linked to the same issue

**URL:** <https://community.eazybi.com/t/count-the-time-spent-for-stories-linked-to-the-same-issue/6989>\
**Category:** Questions & Answers\
**Created:** [June 2, 2021, 8:26am UTC](https://community.eazybi.com/t/count-the-time-spent-for-stories-linked-to-the-same-issue/6989 "2021-06-02T08:26:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![billuh](https://community.eazybi.com/letter_avatar_proxy/v4/letter/b/e9bcb4/32.png) [@billuh](https://community.eazybi.com/u/billuh)\
**Post date:** [June 2, 2021, 8:26am UTC](https://community.eazybi.com/t/count-the-time-spent-for-stories-linked-to-the-same-issue/6989/1 "2021-06-02T08:26:24Z")

</div>

Hello,

I’m newbie in EazyBI and I’m a little bit lost with MDX.

In Jira we have 2 sorts of issues (Features and Story).

The job size in Feature is a T-Shirt size (XS,S,M …) and I woud like to know the real time spent during the implementation of this type of issue.

I use this type of measure : Average workdays in transition status  
Implemented like that :

> ```
> CASE WHEN [Measures].[Transitions from status] > 0 THEN
> [Measures].[Workdays in transition status] /
> [Measures].[Transitions from status]
> END
> 
> ```

But there are a little problem. If we have 2 persons works simultaneously on 2 stories for this feature, the time spent is not good. So I would like to count the time spent in implementation of all stories linked of this feature.

Have you some ideas to implement that ?

---

<div class="post-metadata">

**Author:** ![ilze.leite](https://community.eazybi.com/user_avatar/community.eazybi.com/ilze.leite/32/19_2.png) [@ilze.leite](https://community.eazybi.com/u/ilze.leite)\
**Post date:** [June 7, 2021, 10:20am UTC](https://community.eazybi.com/t/count-the-time-spent-for-stories-linked-to-the-same-issue/6989/2 "2021-06-07T10:20:00Z")

</div>

Hi @billuh

**Average workdays in transition status** shows the average duration the issue has been in the status and is calculated over all issues transited from this status. This measure is **based purely on transitions** - no matter how many users work with this issue (or the actual work does not happen at all). There is no such information related to transitions in Jira.

I would suggest using measure **Hours spent** instead: then all hours logged by users who have worked simultaneously or one by one would be counted.  
If you want to get the average of those hours, you may create the average calculation in Measures:

```auto
    CASE WHEN [Measures].[Issues with hours spent] > 0 THEN
      [Measures].[Hours spent] /
      [Measures].[Issues with hours spent]
    END

```

To show this information at the Feature level, you may want to use some **Issues dimension hierarchy** where Stories are children of Features.  
It depends on how Features and Stories are linked.

- If by **epic link** , then use Issue dimension **Epic hierarchy**.
- If they are based on Advanced Roadmaps (prev. Portfolio) **Parent link** , import **Advanced Roadmaps hierarchy** in Issues dimension: [Advanced Roadmaps custom fields - eazyBI for Jira](https://docs.eazybi.com/eazybijira/data-import/data-from-jira-and-apps/advanced-roadmaps-custom-fields)
- If they are linked using issues **standard links** , you may want to create a **custom hierarchy** in the Issues dimension. Read more about custom hierarchies: [Additional Issue hierarchies - eazyBI for Jira](https://docs.eazybi.com/eazybijira/data-import/advanced-data-import-options/additional-issue-hierarchies)

When used in such hierarchy, then this measure, in a Feature level, would aggregate hours from all its children (stories).

If there are uncertainties about how to proceed, you may contact [support@eazybi.com](mailto:support@eazybi.com) and describe (with screenshots and examples) how Features and Stories are linked and how you would expect to calculate time spent on issues and their children.

Ilze / [support@eazybi.com](mailto:support@eazybi.com)
