Calculated Date-Time Field (by JWT) timeInStatus("Custom_Status") not calculating correctly

Helena March 21, 2022

Hi,

I need to get issues' duration in certain status.

For example, Custom Status is "Planning" (type=Calculated Date-Time Field (by JWT)), and I need to get how long the issue has been in this status (preferably in Days).

Setup: 

Expression: timeInStatus("Planning")

Display format: 

   Format type=Custom format

   Custom date-time format=D

For many of the issues I get the right duration. But for some issues the duration is not correct, and I can't figure out, why. 

I have three this kind of field, and there are cases where 2 of them are correct and one of the three is wrong.

Also tried Custom field type Calculated Number Field (by JWT) and this counts duration correctly on every issue, but the display format is a bit uncomfortable to use for us.

Any idea why Date-Time type duration count is unstable?

Jira Server v8.13.17

2 answers

1 accepted

2 votes
Answer accepted
Fidel Castro
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 21, 2022

Hi @Helena

You have to use a Calculated Number Field field for displaying the number of days, which is indeed a duration. A Calculated Date-Time field can only be used for displaying a moment in time, but neither a number of days or a duration.

If you don't like the default format for duration provided by de Calculated Number Fields, and prefer simply the number of days, you can use the following expression and display format:

EXPRESSION:

floor(timeInStatus("Planning") / (24 * {HOUR}))

CUSTOM DISPLAY FORMAT:

### days

Like shown in the following screenshot:

calculated_field.png

Regards,

Fidel

Helena March 22, 2022

@Fidel Castro Thank You! Calculated Number with your guidance works just how we need.

0 votes
Rashmi V September 22, 2023

Create dated (Created) - current day date (now).

Is there any solution for this

Suggest an answer

Log in or Sign up to answer