# Calculating Blocked time on Issues using Flagged Field

**URL:** <https://community.eazybi.com/t/calculating-blocked-time-on-issues-using-flagged-field/1044>\
**Category:** Questions & Answers\
**Tags:** jira, calculatedmembers\
**Created:** [September 21, 2018, 5:43pm UTC](https://community.eazybi.com/t/calculating-blocked-time-on-issues-using-flagged-field/1044 "2018-09-21T17:43:02Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![janis.plume](https://community.eazybi.com/user_avatar/community.eazybi.com/janis.plume/32/8826_2.png) [@janis.plume](https://community.eazybi.com/u/janis.plume)\
**Post date:** [November 23, 2021, 3:37pm UTC](https://community.eazybi.com/t/calculating-blocked-time-on-issues-using-flagged-field/1044/12 "2021-11-23T15:37:47Z")

</div>

Hi,

The Javascript code gives value for issues having at least one transition to “Impediment” and transition from “Impediment.” The result will not be populated if the issue is for the first time marked as Impediment.

This thread discusses the approach for calculating the days since the last change in the Flagged field: [How long Issue was flagged to Paused (Cumulative) - #6 by janis.plume](https://community.eazybi.com/t/how-long-issue-was-flagged-to-paused-cumulative/6677/6).  
The solution can be used to calculate the days since Flagged as Impediment for the issues currently Flagged.

The calculation of the days since the issue is moved to status should not need the Javascript calculated custom field. The most straightforward way to have the time in current status is:

```auto
CASE WHEN 
[Measures].[Issue status]="Blocked"
THEN
DateDiffDays(
  [Measures].[Issue status updated date],
  Now()
)
END

```

Kindly,  
Janis, eazyBI support

---

_[View the full topic](https://community.eazybi.com/t/calculating-blocked-time-on-issues-using-flagged-field/1044)._
