Priority#

NAME#

Kernel::System::Priority - priority lib

DESCRIPTION#

All ticket priority functions.

PUBLIC INTERFACE#

new()#

create an object

my $PriorityObject = $Kernel::OM->Get('Kernel::System::Priority');

PriorityList()#

get priority list as a hash of ID, Name pairs

my %PriorityList = $PriorityObject->PriorityList(
    Valid => 0,   # (optional) default 1 (0|1)
);

returns

%PriorityList = (
    1 => '1 very low',
    2 => '2 low',
    3 => '3 normal',
    4 => '4 high',
    5 => '5 very high'
)

PriorityGet()#

get priority attributes

my %PriorityData = $PriorityObject->PriorityGet(
    PriorityID => 123,
    UserID     => 1,
);

returns:

%PriorityData = (
    ID         => '123',
    Name       => '123 something',
    ValidID    => '1',
    Color      => '#FF8A25',
    CreateTime => '2021-02-01 12:15:00',
    CreateBy   => '321',
    ChangeTime => '2021-04-01 15:30:00',
    ChangeBy   => '223',
);

PriorityAdd()#

add a ticket priority

my $True = $PriorityObject->PriorityAdd(
    Name    => 'Prio',
    ValidID => 1,
    Color   => '#FF8A25',
    UserID  => 1,
);

PriorityUpdate()#

update a existing ticket priority

my $True = $PriorityObject->PriorityUpdate(
    PriorityID => 123,
    Name       => 'New Prio',
    ValidID    => 1,
    Color      => '#FF8A25',
    UserID     => 1,
);

PriorityLookup()#

returns the id or the name of a priority

my $PriorityID = $PriorityObject->PriorityLookup(
    Priority => '3 normal',
);

my $Priority = $PriorityObject->PriorityLookup(
    PriorityID => 1,
);