otrs -> rel-6_0 API documentation

NAME

Kernel::System::SLA - sla lib

DESCRIPTION

All sla functions.

PUBLIC INTERFACE

new()

Don't use the constructor directly, use the ObjectManager instead:

my $SLAObject = $Kernel::OM->Get('Kernel::System::SLA');

SLAList()

return a hash list of slas

my %SLAList = $SLAObject->SLAList(
    ServiceID => 1,  # (optional)
    Valid     => 0,  # (optional) default 1 (0|1)
    UserID    => 1,
);

SLAGet()

Returns an SLA as a hash

my %SLAData = $SLAObject->SLAGet(
    SLAID  => 123,
    UserID => 1,
);

Returns:

my %SLAData = (
      'SLAID'               => '2',
      'Name'                => 'Diamond Pacific - S2',
      'Calendar'            => '2',
      'FirstResponseTime'   => '60',   # in minutes according to business hours
      'FirstResponseNotify' => '70',   # in percent
      'UpdateTime'          => '360',  # in minutes according to business hours
      'UpdateNotify'        => '70',   # in percent
      'SolutionTime'        => '960',  # in minutes according to business hours
      'SolutionNotify'      => '80',   # in percent
      'ServiceIDs'          => [ '4', '7', '8' ],
      'ValidID'             => '1',
      'Comment'             => 'Some Comment',
      'CreateBy'            => '93',
      'CreateTime'          => '2011-06-16 22:54:54',
      'ChangeBy'            => '93',
      'ChangeTime'          => '2011-06-16 22:54:54',
);

SLALookup()

returns the name or the sla id

my $SLAName = $SLAObject->SLALookup(
    SLAID => 123,
);

or

my $SLAID = $SLAObject->SLALookup(
    Name => 'SLA Name',
);

SLAAdd()

add a sla

my $SLAID = $SLAObject->SLAAdd(
    ServiceIDs          => [ 1, 5, 7 ],  # (optional)
    Name                => 'SLA Name',
    Calendar            => 'Calendar1',  # (optional)
    FirstResponseTime   => 120,          # (optional)
    FirstResponseNotify => 60,           # (optional) notify agent if first response escalation is 60% reached
    UpdateTime          => 180,          # (optional)
    UpdateNotify        => 80,           # (optional) notify agent if update escalation is 80% reached
    SolutionTime        => 580,          # (optional)
    SolutionNotify      => 80,           # (optional) notify agent if solution escalation is 80% reached
    ValidID             => 1,
    Comment             => 'Comment',    # (optional)
    UserID              => 1,
);

SLAUpdate()

update a existing sla

my $True = $SLAObject->SLAUpdate(
    SLAID               => 2,
    ServiceIDs          => [ 1, 2, 3 ],  # (optional)
    Name                => 'Service Name',
    Calendar            => 'Calendar1',  # (optional)
    FirstResponseTime   => 120,          # (optional)
    FirstResponseNotify => 60,           # (optional) notify agent if first response escalation is 60% reached
    UpdateTime          => 180,          # (optional)
    UpdateNotify        => 80,           # (optional) notify agent if update escalation is 80% reached
    SolutionTime        => 580,          # (optional)
    SolutionNotify      => 80,           # (optional) notify agent if solution escalation is 80% reached
    ValidID             => 1,
    Comment             => 'Comment',    # (optional)
    UserID              => 1,
);

SLAPreferencesSet()

set SLA preferences

$SLAObject->SLAPreferencesSet(
    SLAID  => 123,
    Key    => 'UserComment',
    Value  => 'some comment',
    UserID => 123,
);

SLAPreferencesGet()

get SLA preferences

my %Preferences = $SLAObject->SLAPreferencesGet(
    SLAID  => 123,
    UserID => 123,
);

TERMS AND CONDITIONS

This software is part of the OTRS project (https://otrs.org/).

This software comes with ABSOLUTELY NO WARRANTY. For details, see the enclosed file COPYING for license information (GPL). If you did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.