I made a modification in Ticket.pm that allows me to use the queue calendar instead of the SLA calendar.
Explaining: I work with some queues that use different calendars. So, when I move the ticket to another queue, the escalation_solution_time is recalculated.
This modification works well, but sometimes stops working. So I just open and save the Ticket.pm, and the modification works again!
Can anyone explain why this occurs and how to deal with it?
Before:
Code: Select all
...
my %Escalation;
if ( $Self->{ConfigObject}->Get('Ticket::Service') && $Ticket{SLAID} ) {
%Escalation = $Self->{SLAObject}->SLAGet(
SLAID => $Ticket{SLAID},
UserID => $Param{UserID},
Cache => 1,
);
}
else {
%Escalation = $Self->{QueueObject}->QueueGet(
ID => $Ticket{QueueID},
UserID => $Param{UserID},
Cache => 1,
);
}
...
Code: Select all
...
my %Escalation;
my %Escalation_queue;
if ( $Self->{ConfigObject}->Get('Ticket::Service') && $Ticket{SLAID} ) {
%Escalation = $Self->{SLAObject}->SLAGet(
SLAID => $Ticket{SLAID},
UserID => $Param{UserID},
Cache => 1,
);
# Load queue info
%Escalation_queue = $Self->{QueueObject}->QueueGet(
ID => $Ticket{QueueID},
UserID => $Param{UserID},
Cache => 1,
);
# IF SLA CALENDAR IS EMPTY, USE QUEUE CALENDAR
if (!$Escalation{Calendar}){
$Escalation{Calendar} = $Escalation_queue{Calendar};
}
}
else {
%Escalation = $Self->{QueueObject}->QueueGet(
ID => $Ticket{QueueID},
UserID => $Param{UserID},
Cache => 1,
);
}
...