Ticket.pm modification Issue.

Moderator: crythias

Post Reply
vitorcotta
Znuny newbie
Posts: 3
Joined: 04 May 2017, 21:03
Znuny Version: 3.3.14
Real Name: Vitor Cavalcante Cotta
Company: SolloBrasil

Ticket.pm modification Issue.

Post by vitorcotta »

Hi,
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,
        );
    }
...
After:

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,
        );
    }
...
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: Ticket.pm modification Issue.

Post by RStraub »

Are there errors in the log?

Also the syntax "$Self->{QueueObject}" seems old to me, what version are you using?
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
vitorcotta
Znuny newbie
Posts: 3
Joined: 04 May 2017, 21:03
Znuny Version: 3.3.14
Real Name: Vitor Cavalcante Cotta
Company: SolloBrasil

Re: Ticket.pm modification Issue.

Post by vitorcotta »

No errors! I'm using OTRS 3.3.11
Post Reply