I'm using this value to update a custom field to track how long a task was in a specific status. Basically by getting diff between task transtion in and out of status.
My questions are:
Hi @Gabriel Pavel -- Welcome to the Atlassian Community!
My understanding is the businessDays unit of measure, when used with the diff() function, is whole calendar days. It uses the date values only for the difference, ignores any time component, and ignores the definition of working hours for the admin site configuration.
And, there is no built-in businessHours unit of measure for the date/time operations.
I believe it is possible to manually code both of these concepts into a rule, and if you search you may find some questions about those. I recall experimenting with this and found I needed to hard-code in the time ranges as created variables could not be used in functions.
Such rules would need to handle working days, time zones, the ranges of time before/during/after the work day schedule, and potentially also holidays. (Holidays, or non-working days configured by project, are also ignored by automation rule functions.)
I recall another post where a rule writer instead created an external web service to perform the math, and then called that from their rule with a web request. That turned out to be both easier to implement and maintain than to do the calculations in an automation rule.
Kind regards,
Bill
Thanks Bill, so even if I apply the diff on a Timestamp type field (that has date and time) and not a Date type field that has only date, it will still only look at the days? So it will count:
18/07/2023 00;00 - 17/07/2023 00;00 same as say: 18/07/2023 23;00 - 17/07/2023 05;00 = 1 day?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is correct. You can test things like this to learn how the functions work using test rules and created variables (or issue fields).
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.