How do I determine if SLA Calendar should be used or Queue Calendar should be used with just a ticket info?

Moderator: crythias

Post Reply
OTRSRDNewbie
Znuny newbie
Posts: 69
Joined: 29 Apr 2016, 10:23
Znuny Version: 3.2, 5
Real Name: Dennis Cua
Company: N/A

How do I determine if SLA Calendar should be used or Queue Calendar should be used with just a ticket info?

Post by OTRSRDNewbie »

How do I determine if SLA Calendar should be used or Queue Calendar should be used with just a ticket info?

What I mean for Escalation calculation, one could set a SLA escalation or a Queue escalation. But that's automatic for escalation, I'm trying to do a time calculation in a GenericAgent. Given a ticket I think I could only know who the owner and responsible person.

If there are morning shifts, mid shift, graveyard shift. The calendar will be different too. Escalation calculation maybe I can leave to the otrs system. In terms of ITIL standard or usual standards how will I program the GenericAgent to choose between SLA calendar or Queue calendar if say SLA has a calendar assigned, and queueu has a different calendar ... Is there a function I can call to see how the administrator has set sys config to prioritize a calendar?
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: How do I determine if SLA Calendar should be used or Queue Calendar should be used with just a ticket info?

Post by reneeb »

SLA has higher precedence than Queue...
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
siraction
Znuny newbie
Posts: 6
Joined: 19 Dec 2013, 13:32
Znuny Version: 5.0.4
Real Name: Cristiano Barabanti
Company: ToolsGroup

Re: How do I determine if SLA Calendar should be used or Queue Calendar should be used with just a ticket info?

Post by siraction »

reneeb wrote:SLA has higher precedence than Queue...
And what If I set no calendar to SLA, will it use the Queue one?
vitorcotta
Znuny newbie
Posts: 3
Joined: 04 May 2017, 21:03
Znuny Version: 3.3.14
Real Name: Vitor Cavalcante Cotta
Company: SolloBrasil

Re: How do I determine if SLA Calendar should be used or Queue Calendar should be used with just a ticket info?

Post by vitorcotta »

Hi, I think I have a solution.
If you use SLA, OTRS will use the SLA calendar. We hope that when the calendar is not set up for SLA, OTRS uses the queue calendar. But this is not happening!

This is because when you use SLA, the calendar precedence is SLA -> System.

If you do not use SLA the calendar precedence is Queue -> System.

See the code on Ticker.pm

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,
        );
    }
...
So I decide to use the precedence SLA -> Queue -> System, modifing the Ticker.pm.

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,
        );
    }
...
This is work fine for me! Try at your own risk! Always backup first!
PS.: Sorry for my bad English!
Post Reply