Kernel::System::SLA

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,
    );

SLAListGet()

return a list of slas with the complete list of attributes for each sla

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

    returns

    $SLAList = [
        {
          'SLAID'               => '1',
          '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',
          'TypeID'                  => '5',
          'Type'                    => 'Incident',
          'MinTimeBetweenIncidents' => '4000',  # in minutes
          'CreateBy'            => '93',
          'CreateTime'          => '2011-06-16 22:54:54',
          'ChangeBy'            => '93',
          'ChangeTime'          => '2011-06-16 22:54:54',
        },
        {
          'SLAID'               => '2',
          'Name'                => 'Example SLA',
          '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',
          'TypeID'                  => '5',
          'Type'                    => 'Incident',
          'MinTimeBetweenIncidents' => '4000',  # in minutes
          'CreateBy'            => '93',
          'CreateTime'          => '2011-06-16 22:54:54',
          'ChangeBy'            => '93',
          'ChangeTime'          => '2011-06-16 22:54:54',
        },
        # ...
    ];

SLASearch()

return sla ids as an array

    my @SLAList = $SLAObject->SLASearch(
        Name             => 'Service Name',                        # (optional)
        Limit            => 122,                                   # (optional) default 1000
        UserID           => 1,
        Comment          => 'Example*',
        Valid            => 1,                                     # (optional) default 1 (0|1)
        TypeIDs          => [ 2, 3 ] || 2,
        Types            => [ 'Test', 'Example' ] || 'Test',
        ServiceIDs       => [ 2, 3 ] || 3,
        Calendars        => [ 'Calendar Name', 'Example Calendar' ] || 2,
        CreatedBy        => [ 1, 2 ] || 2,
        ChangedBy        => [ 1, 2 ] || 2,
        OrderBy          => 'Name',
        OrderDirection   => 'Up' (Up|Down),
    );

SLAGet()

Returns an SLA as a hash

    my %SLAData = $SLAObject->SLAGet(
        SLAID              => 123,
        UserID             => 1,
        IncludePreferences => '0|1' # optional, default '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',
          'TypeID'                  => '5',
          'Type'                    => 'Incident',
          'MinTimeBetweenIncidents' => '4000',  # in minutes
          '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,
        TypeID                  => 2,
        MinTimeBetweenIncidents => 3443,     # (optional)
    );

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,
        TypeID                  => 2,
        MinTimeBetweenIncidents => 3443,  # (optional)
    );

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,
    );

SLAPreferencesDelete()

Delete SLA preferences

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

SLADelete()

Delete a SLA

    my $Success = $SLAObject->SLADelete(
        SLAID    => 123,
        UserID   => 123,
    );
Scroll to Top