Calculated Date field - get status?

Markus September 18, 2018

Is it possible to use the calculated Date field to calculate how long it took an issue to go from status A to Status C?

Basically something like: (Date Issue moved to Status C) - (Date Issue moved to Status A)??? 

We need to calculate some benchmarks that depend on the average speed of the issues inside the project. I mean JIRA stores the information for each issue but its pretty difficult to use this information. IF anyone has another idea, please tell me. 

2 answers

1 accepted

1 vote
Answer accepted
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 18, 2018

Hi Markus,

you could use two "Transition Date/Time Custom Fields" and then a "Calculated Number Field" from the JMCF app (disclaimer: I am the author of that app).

Markus September 18, 2018

Hi, thanks! But what would the formula be two substract both fields from each other?

This didnt work:

<!-- @@Formula:
return issue.get("FieldB") - issue.get("FieldA");
-->

https://community.atlassian.com/t5/Jira-questions/Formula-Calculated-Date/qaq-p/894051#M286662

Regards.

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 18, 2018

You need to use getTime() to return the number of milliseconds, and then divide the difference by the appropriate number of milliseconds for your unit of choice. For example, to return a number of hours:

<!-- @@Formula:
return (issue.get("FieldB").getTime() - issue.get("FieldA").getTime()) / 1000L / 3600L;
-->

Note that you should also protect your formula against null values (if one of the transitions was not executed yet):

<!-- @@Formula:
if (issue.get("FieldA") == null || issue.get("FieldB") == null)
  return null;
return (issue.get("FieldB").getTime() - issue.get("FieldA").getTime()) / 1000L / 3600L;
-->
Marg September 18, 2018

Thank you will try it out tomorrow. 

Markus September 19, 2018

Thank you very much! It works perfectly!!!!

0 votes
Lime Trees September 18, 2018

Hi,

you can have a look at our free add-on Status History which shows statuses and their times directly on each issue. More details you can find in User Guide.

If you need something more, please also check Status History PRO - its reports and special viewer to analyze issues in project.

Regards,

Lime Trees Support Team

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events