Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Smart value BusinessDays questions

Gabriel Pavel
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 21, 2023

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:

  • How is it really counted? In know business days are considered mon-fri 8-18, but what counts as 1 business day (4 hours in that interval, 8h in that interval, etc?) Basically how roundiong works?
  • Is there a way to have a simillar logic for business hours? Beacuse using just .hours for my purpose would no work as it would count out of office hours as well.

 

 

 

1 answer

2 votes
Bill Sheboy
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.
July 21, 2023

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

Gabriel Pavel
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 22, 2023

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?

Bill Sheboy
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.
July 22, 2023

That is correct.  You can test things like this to learn how the functions work using test rules and created variables (or issue fields).

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events