Automatic Timer counts time on weekends and nights

Hi Everyone,

 

I'm using a standard time tracking workflow, in the global settings it is indicated that we have 8 hours working day, and Sunday and Saturday are days off.

Despite of that, when I put a test task in 19:24 Friday evening, youtrack counts 8 hours every day, and Monday morning it says that the task were in work for 24 hours. 

 

It's does not matter when I put my task in progress, in an evening or in a morning.
I've tried this workflow in other days as well. And no luck — 8 hours count every 24 hours, including off hours.

The story the same on standalone installation as well. 

 

Any advise on this?

0
9 comments
Official comment

Hi Alex, could you please attach screenshots of your global Time Tracking settings + the time tracking settings of that particular project?

Also, let us know which workflow you're using, is it the 'In Progress Work Timer'? Have you changed this default workflow yourselves in any way?

Are you currently using an InCloud YouTrack instance or a standalone installation? If you're in the cloud, let us know the name of your instance.

Thank you!

 

Feel free to submit a support request to answer these questions and provide additional details if you consider any data to be sensitive.

Hello, I am having the same issue, in "Time Tracking" settings days are set only weekdays, 8 hours per day, and im using "In Progress Work Timer". If I set "In progress" on Friday and stop it on Monday, it will count me 2 days of work. Any ideas?

0

Hello,

Thank you for reaching out. The "in progress work timer" workflow doesn't consider weekends and nights by default. You can enhance it though by hardcoding your working days and hours and adjusting the calculated time according to those conditions. Please let me know if it helps.  

0

I haven't changed any workflow for "In progress". 
Would be great if you could provide me an example how to enhance this workflow to ignore weekends or include only working days and hours.

0

Hello,

The intervalToWorkingMinutes method calculates time according to the Time Tracking settings. So, would you please check that your working time is set correctly?

 

 

0

Здравствуйте! 

У меня такая же проблема, есть ли для нее решение? Функция intervalToWorkingMinutes(start, end) не учитывает выходные дни. В глобальных настройках учета времени выходными днями выбраны Суббота и Воскресенье. Но если вызывать это функцию с указанием start = пятница, end = понедельник, тогда она вернет 3 рабочих дня (а точнее 1440 минут -> 24 рабочих часа -> 3 рабочих дня, т.к. в настройках указан 8ми часовой день).

Я проверил работу этой функции более детально и выяснил, что рабочее время не учитывается только в том случае, если start = end - 6 или start = end - 7 независимо от фактических дней недели, на которые выпадают start и end. То есть если будет start = end - 1, но end - это суббота, а start - это пятница (вечер), то функция все равно вернет 1 рабочий день (то есть суббота выходная не учлась).

Есть шанс, что это исправится?

Скрин настроек учета времени

UPD

2 примера выполнения кода. Общая логика: беру фиксированную дату окончания (END) и по одному дню двигаю дату начала (START) в прошлое. В результате вывожу количество рабочего времени, рассчитываемое функцией intervalToWorkingMinutes(start, end)

Пример 1, дата окончания Понедельник

//Код
var start = new Date();
var end = new Date(2021, 2, 15, 22, 0, 0, 0); //Monday March 15, 2021 at 10:00:00 PM YEKT

var i = 1;
while (i<=20) {
start.setTime(end.getTime() - days(i));
console.log('START = ' + start.toString(), 'END = ' + end.toString());
var tmp = issue.project.intervalToWorkingMinutes(start.getTime(), end.getTime());
console.log('intervalToWorkingMinutes(start, end) = ' + tmp + ' -> ' + tmp/60 + ' work hours -> ' + tmp/60/8 + ' work days');
i++;
}

//Результат
START = Sun Mar 14 2021 22:00:00 GMT+0500 (YEKT),END = Mon Mar 15 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 480 -> 8 work hours -> 1 work days

START = Sat Mar 13 2021 22:00:00 GMT+0500 (YEKT),END = Mon Mar 15 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 960 -> 16 work hours -> 2 work days

START = Fri Mar 12 2021 22:00:00 GMT+0500 (YEKT),END = Mon Mar 15 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 1440 -> 24 work hours -> 3 work days

START = Thu Mar 11 2021 22:00:00 GMT+0500 (YEKT),END = Mon Mar 15 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 1920 -> 32 work hours -> 4 work days

START = Wed Mar 10 2021 22:00:00 GMT+0500 (YEKT),END = Mon Mar 15 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 2400 -> 40 work hours -> 5 work days

START = Tue Mar 09 2021 22:00:00 GMT+0500 (YEKT),END = Mon Mar 15 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 2400 -> 40 work hours -> 5 work days

START = Mon Mar 08 2021 22:00:00 GMT+0500 (YEKT),END = Mon Mar 15 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 2400 -> 40 work hours -> 5 work days

START = Sun Mar 07 2021 22:00:00 GMT+0500 (YEKT),END = Mon Mar 15 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 2880 -> 48 work hours -> 6 work days

START = Sat Mar 06 2021 22:00:00 GMT+0500 (YEKT),END = Mon Mar 15 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 3360 -> 56 work hours -> 7 work days

START = Fri Mar 05 2021 22:00:00 GMT+0500 (YEKT),END = Mon Mar 15 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 3840 -> 64 work hours -> 8 work days

START = Thu Mar 04 2021 22:00:00 GMT+0500 (YEKT),END = Mon Mar 15 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 4320 -> 72 work hours -> 9 work days

START = Wed Mar 03 2021 22:00:00 GMT+0500 (YEKT),END = Mon Mar 15 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 4800 -> 80 work hours -> 10 work days

START = Tue Mar 02 2021 22:00:00 GMT+0500 (YEKT),END = Mon Mar 15 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 4800 -> 80 work hours -> 10 work days

START = Mon Mar 01 2021 22:00:00 GMT+0500 (YEKT),END = Mon Mar 15 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 4800 -> 80 work hours -> 10 work days

START = Sun Feb 28 2021 22:00:00 GMT+0500 (YEKT),END = Mon Mar 15 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 5280 -> 88 work hours -> 11 work days

START = Sat Feb 27 2021 22:00:00 GMT+0500 (YEKT),END = Mon Mar 15 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 5760 -> 96 work hours -> 12 work days

START = Fri Feb 26 2021 22:00:00 GMT+0500 (YEKT),END = Mon Mar 15 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 6240 -> 104 work hours -> 13 work days

START = Thu Feb 25 2021 22:00:00 GMT+0500 (YEKT),END = Mon Mar 15 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 6720 -> 112 work hours -> 14 work days

START = Wed Feb 24 2021 22:00:00 GMT+0500 (YEKT),END = Mon Mar 15 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 7200 -> 120 work hours -> 15 work days

START = Tue Feb 23 2021 22:00:00 GMT+0500 (YEKT),END = Mon Mar 15 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 7200 -> 120 work hours -> 15 work days

Пример 2. Дата окончания Среда

//Код
var start = new Date();
var end = new Date(2021, 2, 17, 22, 0, 0, 0); //Wednesday March 17, 2021 at 10:00:00 PM YEKT

var i = 1;
while (i<=20) {
start.setTime(end.getTime() - days(i));
console.log('START = ' + start.toString(), 'END = ' + end.toString());
var tmp = issue.project.intervalToWorkingMinutes(start.getTime(), end.getTime());
console.log('intervalToWorkingMinutes(start, end) = ' + tmp + ' -> ' + tmp/60 + ' work hours -> ' + tmp/60/8 + ' work days');
i++;
}

//Результат
START = Tue Mar 16 2021 22:00:00 GMT+0500 (YEKT),END = Wed Mar 17 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 480 -> 8 work hours -> 1 work days

START = Mon Mar 15 2021 22:00:00 GMT+0500 (YEKT),END = Wed Mar 17 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 960 -> 16 work hours -> 2 work days

START = Sun Mar 14 2021 22:00:00 GMT+0500 (YEKT),END = Wed Mar 17 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 1440 -> 24 work hours -> 3 work days

START = Sat Mar 13 2021 22:00:00 GMT+0500 (YEKT),END = Wed Mar 17 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 1920 -> 32 work hours -> 4 work days

START = Fri Mar 12 2021 22:00:00 GMT+0500 (YEKT),END = Wed Mar 17 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 2400 -> 40 work hours -> 5 work days

START = Thu Mar 11 2021 22:00:00 GMT+0500 (YEKT),END = Wed Mar 17 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 2400 -> 40 work hours -> 5 work days

START = Wed Mar 10 2021 22:00:00 GMT+0500 (YEKT),END = Wed Mar 17 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 2400 -> 40 work hours -> 5 work days

START = Tue Mar 09 2021 22:00:00 GMT+0500 (YEKT),END = Wed Mar 17 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 2880 -> 48 work hours -> 6 work days

START = Mon Mar 08 2021 22:00:00 GMT+0500 (YEKT),END = Wed Mar 17 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 3360 -> 56 work hours -> 7 work days

START = Sun Mar 07 2021 22:00:00 GMT+0500 (YEKT),END = Wed Mar 17 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 3840 -> 64 work hours -> 8 work days

START = Sat Mar 06 2021 22:00:00 GMT+0500 (YEKT),END = Wed Mar 17 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 4320 -> 72 work hours -> 9 work days

START = Fri Mar 05 2021 22:00:00 GMT+0500 (YEKT),END = Wed Mar 17 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 4800 -> 80 work hours -> 10 work days

START = Thu Mar 04 2021 22:00:00 GMT+0500 (YEKT),END = Wed Mar 17 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 4800 -> 80 work hours -> 10 work days

START = Wed Mar 03 2021 22:00:00 GMT+0500 (YEKT),END = Wed Mar 17 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 4800 -> 80 work hours -> 10 work days

START = Tue Mar 02 2021 22:00:00 GMT+0500 (YEKT),END = Wed Mar 17 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 5280 -> 88 work hours -> 11 work days

START = Mon Mar 01 2021 22:00:00 GMT+0500 (YEKT),END = Wed Mar 17 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 5760 -> 96 work hours -> 12 work days

START = Sun Feb 28 2021 22:00:00 GMT+0500 (YEKT),END = Wed Mar 17 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 6240 -> 104 work hours -> 13 work days

START = Sat Feb 27 2021 22:00:00 GMT+0500 (YEKT),END = Wed Mar 17 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 6720 -> 112 work hours -> 14 work days

START = Fri Feb 26 2021 22:00:00 GMT+0500 (YEKT),END = Wed Mar 17 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 7200 -> 120 work hours -> 15 work days

START = Thu Feb 25 2021 22:00:00 GMT+0500 (YEKT),END = Wed Mar 17 2021 22:00:00 GMT+0500 (YEKT)
intervalToWorkingMinutes(start, end) = 7200 -> 120 work hours -> 15 work days

Вывод

В каждом примере разные дни являются выходными, несмотря на настройки рабочего времени ютрэка. Если двигаемся по одному дню назад - тогда рабочее время не будет добавляться каждый 6ой и 7й день.

0

Здравствуйте, Виктор.

Спасибо за детальное описание Вашего исследования! Я создала соответствующий баг в нашем трекере: https://youtrack.jetbrains.com/issue/JT-62926. Проголосуйте за него, пожалуйста, чтобы подписаться на уведомления о его изменениях.

0

Алиса, здравствуйте! Спасибо, подписался.

Подскажите, когда примерно ожидать исправление? Можно на него рассчитывать в ближайшем времени? В противном случае придется обходное решение какое-то выдумывать...

0

Виктор,

Надеюсь, что ошибка будет исправлена как можно скорее, но никаких конкретных сроков обещать не могу, к сожалению.

0

Please sign in to leave a comment.