Hey everyone,
I'm looking to add a Jira automation rule for the following:
- IF sub-task transitioned to DONE status, THEN show the # of days it took to complete the sub-task in a field on the sub-task screen
I have been able to accomplish this by adding the following within a field called "Total Duration":
{{issue.created.diff(now).days}} Days
The problem is that this displays the following:
- Example:
- Created: 8/24/23 & 8:00AM
- Transitioned to DONE: 8/24/23 @ 5:00PM
- Total Duration: 0
The total duration is rounding to the nearest whole day, not showing partial days. In the example above, the sub-task took 9hrs to complete which is 9/24 --> 0.375 Days. How can I get it to show days in a decimal format?
Thank you!
Have you tried using either:
The approach you use will depend upon your specific scenario / needs.
And also...what you seem to be measuring is often called Lead Time (i.e., from request to completion time). If you want the actual working time you could use the built-in Control Chart report, or do something a bit more to measure in-progress time, like with this how-to for Age of WIP: https://community.atlassian.com/t5/Automation-discussions/What-is-your-most-useful-automation-Here-is-mine/m-p/1561072#M34
Kind regards,
Bill
@Bill Sheboy Thanks for the response.
I was hoping that a simple change like below would work:
{{(issue.created.diff(now).minutes)/1440}} Days
Unfortunately, it doesn't. I'll look into your approach as well.
Thanks again!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
With that approach, you are close. Please try this adjustment:
{{issue.created.diff(now).minutes.divide(1440)}} Days
There are two formats for math expressions: in-line and the longer form. However they cannot be combined, which is what you were doing.
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The adjustment above does work, but it still seems to exclude any decimal points after the whole day value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My mistake: the rule is trying to "help" by using the precision from the left-most value in the expression. We can force this like this:
{{#=}}ROUND({{issue.created.diff(now).minutes}}/1440,3){{/}}
Please adjust the 3 in the ROUND() call to your desired precision.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.