You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2014-12-17 00:45:32

j.novak@netsystem.cz
Member
Registered: 2014-12-17
Posts: 4

SLA with no calendar is evaluated bad way on 0.85.1 [resolved]

Hi,

I found that when SLA has no calendar assigned (GUI shows as 24/7), this SLA is escalated over all levels when SLA is assigned to new ticket. The user e.g. receives all escalation notifications at once.

Procedure to reproduce:
0) system is configured to accept new tickets by email and new ticket is assigned to technican or group
1) create SLA:
- calendar: 24/7
- time to solve: 4 hours
- escalation levels:
  - -3h -> Automatic reminders of SLA
  - -2h -> Automatic reminders of SLA
2) create any business rule to assign this SLA to new tickets
3) send email to create new ticket
4) technican will receive two emails about SLA reminder in row
5) change calendar in SLA from step 1) to any defined calendar
6) repeat step 3) and you will receive no SLA reminder

I found that this bug is caused by inc/sla.class.php which was changed between 0.84 and 0.85. I made patch to fix the issue, see bellow.

Sincerely yours,

Jirka Novak


*** sla.class.php.orig>-2014-12-16 23:20:26.233555915 +0100
--- sla.class.php>2014-12-16 23:22:00.577990769 +0100
***************
*** 381,393 ****
                                                   $slalevel->fields['execution_time'] + $additional_delay,
                                                   $work_in_days);
                    }
--
-                   // No calendar defined or invalid calendar
-                   $delay    += $additional_delay+$slalevel->fields['execution_time'];
-                   $starttime = strtotime($start_date);
-                   $endtime   = $starttime+$delay;
-                   return date('Y-m-d H:i:s',$endtime);
                 }
              }
           }
        }
--- 381,393 ----
                                                   $slalevel->fields['execution_time'] + $additional_delay,
                                                   $work_in_days);
                    }
                 }
+-
+                // No calendar defined or invalid calendar
+                $delay    += $additional_delay+$slalevel->fields['execution_time'];
+                $starttime = strtotime($start_date);
+                $endtime   = $starttime+$delay;
+                return date('Y-m-d H:i:s',$endtime);
              }
           }
        }

Offline

#2 2014-12-20 18:49:39

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,278

Re: SLA with no calendar is evaluated bad way on 0.85.1 [resolved]

I don't see the difference in your patch.


CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6  - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

#3 2014-12-22 11:09:22

j.novak@netsystem.cz
Member
Registered: 2014-12-17
Posts: 4

Re: SLA with no calendar is evaluated bad way on 0.85.1 [resolved]

The difference is move of closing '}' by one level in if clausule.
Check count of '}' before comment '// No calendar defined or invalid calendar'.

The issue is that default settings for no calendar are on wrong branch of if sequence.

Offline

Board footer

Powered by FluxBB