How work time is calculated in Automated Log Work Cloud

Manual and automatic modes use the same configuration and algorithm for work time calculation.

Table of Contents

Configuration

You can set the number of working hours per day and working days in plugin configuration (see General and project settings for Automated Log Work Cloud).

Default setting for working hours per day is 8 hours.

Default settings for working days are Monday, Tuesday, Wednesday, Thursday and Friday.


Calculation algorithm

Automated Log Work add-on uses smart algorithm to decide how much time should be logged.

It takes into account working hours per day and working days when timer spans more than one day. Thanks to that timer does not have to be stopped overnight or over the weekend and time logged is still precise.

Time logged does not depend on exact business hours what is explained in examples.


Running timer means that user pressed "Start Timer" button in Manual mode or moved issue to active status (e.g. "In Progress") in Automated mode.

Scenario 1: timer starts and stops on the same day

In this scenario the exact time difference is logged, despite of working hours per day configuration value, e.g:

  • Timer starts at 9am and stops at 4pm: "7h" is saved to JIRA worklog. 
  • Timer starts at 7am and stops at 4:50pm: "9h 50m" is saved to JIRA worklog.

Please note that in the second example more than "8h" is logged. 

Scenario 2: timer starts and stops on different days

Let's assume that we use default values for working hours per day and working days which are ("8h" and "Mon, Tue, Wed, Thu, Fri" accordingly). 

In "different days" scenario our smart algorithm detects overnight and over-the-weekend work and skips redundant time to log only real working hours, e.g.:

  • Timer starts at 1pm one day and stops at 9am next day - "4h" is saved to JIRA worklog
  • Timer starts at 5pm one day and stops at 11am next day - "2h" is saved to JIRA worklog
  • Timer starts at 5:45pm one day and stops 9am next day.

Let's explain the second example:

Because the start/stop timer events happened in different days, it means there was "overnight" time tracked and we definitely don't want to save it to JIRA worklog so our smart calculation starts. 

Stop event happened at 11am which means that it is the latest time the user started work that day (work day could start earlier though). Let's temporarily assume that work day started exactly at that time (it might sound weird and incorrect but later on that assumption does not matter!). 

Next, if user starts work at 11am and "working hours per day" is set to 8h then it means that user stops the work 8 hours later which is 7pm

Next, it means that user worked from 5pm to 7pm. It gives 2h and this value is saved to JIRA worklog.

The initial assumption that user work day starts at 11am and ends at 7pm does not matter. We get the same final result if we assume 9am - 5pm or any other time window that spans both timer start and stop times.

The only important assumptions are:

  • User starts and ends work at the same time on a first and last day (timer might work for several days or weeks). It might not always be true but that is the best what we can assume. 
  • User starts and stops timer in the time span that is less or equal to the working hours per day configuration option.

If the above assumptions are not satisfied then calculation algorithm will return less precise outcome, what is explained below.

Let's explain the third example:

Time difference between 9am and 5:45pm is 8:45 hours and it is longer than 8 hours specified in working hours per day configuration option. Therefore our algorithm is not able to tell if and when user left the office. 

In such case we assume that user worked throughout the night and time calculated from 5:45pm to 9am next day is 15 hours and 15 minutes (it is equal to 8h + 7h + 15m = 1d 7h 15m). 

If we increase working hours per day value and set it to 9h then we get 15m as an outcome of our algorithm that is saved to JIRA worklog.


Calculation algorithm is very precise but only if working hours per day and working days configuration options are set correctly according to the real time spent at work.

Non-working days (weekends) are not counted. If user starts or stops timer on non-working day then our algorithm assumes it is a working day (despite of configuration setting).

Working business hours

Several customers requested a configuration option to specify precise hours when users come to office and next leave the office

We want to explain that such option would not improve accuracy of time tracking but make it worse. 

As explained in the previous paragraph, our algorithm works fine despite of actual time when user enters and next leaves the office. The only conditions that must be satisfied are:

  1. User works as long as defined in configuration (working hours per day and working days)
  2. User starts and ends work at the same time on the first and last day (timer might work for several days or weeks)

The proposed "enter/leave office hours" solution is even more strict as it requires following to work correctly:

  1. User works as long as defined in configuration but also in specified hours (e.g. between 7am and 3pm). 
    In our original algorithm it is enough if users works 8 hours, it might be 7am-3pm or 9am-5pm so it is more flexible. 
  2. User by definition starts and ends work at the same time on the first and last day of work (when timer works for several days or weeks)
    This assumption is exactly the same as in our original algorithm. 


Overall, our working time calculation algorithm is less strict and therefore more precise in its current shape. Adding precise hours when user enters and leaves the office would make it less accurate.

Hints

If time that user spends at work is varying, then starting and stopping timer every day is the only possibility to calculate time precisely.

That can be achieved with pressing Start/Stop Timer button in manual mode or moving issue back and forth between In Progress and Open statuses in automated mode every day.

Manual mode is more suitable if you often switch between tasks and don't want to transition issue between statuses.