Community Announcements have moved! To stay up to date, please join the new Community Announcements group today. Learn more
×Hello!
We are attempting to automate the action of logging work on an issue when it transitions to the 'Done' status, while taking standard Business hours into consideration.
Our current automation is based on a custom field against the current date/time formatted for Business Days, but we would love to know if anyone has a solution to be able to capture the difference between two date/time fields with the difference being logged in native Time Tracking.
There are two hurdles that we are facing right now from our perspective:
1. How can we capture the day, hour, minute difference between two custom fields in the formatting required for 'Log Work', (i.e. 4d 3h 27m)
2. How do we take 'Business Days' into consideration to avoid capturing time that isn't during standard business hours?
Thank you!
Hello @Stephen Call
As you are looking for native capabilities to accomplish this, I have the below suggestions:
1.For formatted print, you can use the command, prettyPrint, which displays the difference in words, e.g.: 2 days 3 hours.,
2. For calculating difference in terms of business days, you can use the below method:
Date difference {{[date1].diff([date2]).[unit]}}; where the unit can be "businessDays".
The details for both options are captured under the Date Difference section on the documentation, here.
Kindly share if this helps.
--GG
You can get using diff() between two date/time fields (see how you can use diff function here in detail), then format the result for days/hours/minutes with toDuration or string formatting before passing it to the “Log work” action.
For business hours, Jira Automation doesn’t natively support excluding non-working hours from diff(). You’d need to either:
Pre-calculate business time with a separate field or external script, or
Use an external app or a Marketplace app that can handle business calendars in smart values (I don't know if there is one).
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.