
#####
Queue
#####


****
NAME
****


Kernel::System::Queue - queue lib


***********
DESCRIPTION
***********


All queue functions. E. g. to add queue or other functions.


****************
PUBLIC INTERFACE
****************


new()
=====


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


.. code-block:: perl

     my $QueueObject = $Kernel::OM->Get('Kernel::System::Queue');



GetSystemAddress()
==================


get a queue system email address as hash (Email, RealName)


.. code-block:: perl

     my %Address = $QueueObject->GetSystemAddress(
         QueueID => 123,
     );



GetSignature()
==============


get a queue signature


.. code-block:: perl

     my $Signature = $QueueObject->GetSignature(QueueID => 123);



QueueStandardTemplateMemberAdd()
================================


to add a template to a queue


.. code-block:: perl

     my $Success = $QueueObject->QueueStandardTemplateMemberAdd(
         QueueID            => 123,
         StandardTemplateID => 123,
         Active             => 1,        # to set/confirm (1) or remove (0) the relation
         UserID             => 123,
     );



QueueStandardTemplateMemberList()
=================================


get standard responses of a queue


.. code-block:: perl

     my %Templates = $QueueObject->QueueStandardTemplateMemberList( QueueID => 123 );


Returns:


.. code-block:: perl

     %Templates = (
         1 => 'Some Name',
         2 => 'Some Name',
     );
 
     my %Responses = $QueueObject->QueueStandardTemplateMemberList(
         QueueID       => 123,
         TemplateTypes => 1,
     );


Returns:


.. code-block:: perl

     %Responses = (
         Answer => {
             1 => 'Some Name',
             2 => 'Some Name',
         },
         # ...
     );
 
     my %Queues = $QueueObject->QueueStandardTemplateMemberList( StandardTemplateID => 123 );


Returns:


.. code-block:: perl

     %Queues = (
         1 => 'Some Name',
         2 => 'Some Name',
     );



GetAllQueues()
==============


get all valid system queues


.. code-block:: perl

     my %Queues = $QueueObject->GetAllQueues();


get all system queues of a user with permission type (e. g. \ ``ro``\ , \ ``move_into``\ , \ ``rw``\ , ...)


.. code-block:: perl

     my %Queues = $QueueObject->GetAllQueues( UserID => 123, Type => 'ro' );



GetAllCustomQueues()
====================


get all custom queues of one user


.. code-block:: perl

     my @Queues = $QueueObject->GetAllCustomQueues( UserID => 123 );



QueueLookup()
=============


get id or name for queue


.. code-block:: perl

     my $Queue = $QueueObject->QueueLookup( QueueID => $QueueID );
 
     my $QueueID = $QueueObject->QueueLookup( Queue => $Queue );



GetFollowUpOption()
===================


get FollowUpOption for the given QueueID


.. code-block:: perl

     my $FollowUpOption = $QueueObject->GetFollowUpOption( QueueID => $QueueID );


returns any of 'possible', 'reject', 'new ticket'.


GetFollowUpOptionList()
=======================


get Follow-Up Option list


.. code-block:: perl

     my %FollowUpOptionList = $QueueObject->GetFollowUpOptionList(
         Valid => 0,             # (optional) default 1
     );


Return:


.. code-block:: perl

     %FollowUpOptionList = (
         '1' => 'possible',
         '3' => 'new ticket',
         '2' => 'reject',
     )



GetFollowUpLockOption()
=======================


get FollowUpLockOption for the given QueueID


.. code-block:: perl

     my $FollowUpLockOption = $QueueObject->GetFollowUpLockOption( QueueID => $QueueID );


returns '1' if ticket should be locked after a follow up, '0' if not.


GetQueueGroupID()
=================


get GroupID defined for the given QueueID.


.. code-block:: perl

     my $GroupID = $QueueObject->GetQueueGroupID( QueueID => $QueueID );



QueueAdd()
==========


add queue with attributes


.. code-block:: perl

     my $QueueID = $QueueObject->QueueAdd(
         Name                => 'Some::Queue',
         ValidID             => 1,
         GroupID             => 1,
         Calendar            => '1',         # (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)
         UnlockTimeout       => 480,         # (optional)
         FollowUpID          => 3,           # possible (1), reject (2) or new ticket (3) (optional, default 0)
         FollowUpLock        => 0,           # yes (1) or no (0) (optional, default 0)
         DefaultSignKey      => 'key name',  # (optional)
         SystemAddressID     => 1,
         SalutationID        => 1,
         SignatureID         => 1,
         Comment             => 'Some comment',
         UserID              => 123,
     );



QueueGet()
==========


get queue attributes


.. code-block:: perl

     my %Queue = $QueueObject->QueueGet(
         ID => 123,
     );
 
     my %Queue = $QueueObject->QueueGet(
         Name  => 'Some::Queue',
     );



QueueUpdate()
=============


update queue attributes


.. code-block:: perl

     my $Success = $QueueObject->QueueUpdate(
         QueueID             => 123,
         Name                => 'Some::Queue',
         ValidID             => 1,
         GroupID             => 1,
         Calendar            => '1', # (optional) default ''
         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)
         SystemAddressID     => 1,
         SalutationID        => 1,
         SignatureID         => 1,
         UserID              => 123,
         FollowUpID          => 1,
         Comment             => 'Some Comment2',
         DefaultSignKey      => '',
         UnlockTimeOut       => '',
         FollowUpLock        => 1,
         ParentQueueID       => '',
     );



QueueList()
===========


get all queues


.. code-block:: perl

     my %Queues = $QueueObject->QueueList();
 
     my %Queues = $QueueObject->QueueList( Valid => 1 );



QueuePreferencesSet()
=====================


set queue preferences


.. code-block:: perl

     $QueueObject->QueuePreferencesSet(
         QueueID => 123,
         Key     => 'UserComment',
         Value   => 'some comment',
         UserID  => 123,
     );



QueuePreferencesGet()
=====================


get queue preferences


.. code-block:: perl

     my %Preferences = $QueueObject->QueuePreferencesGet(
         QueueID => 123,
         UserID  => 123,
     );



NameExistsCheck()
=================


return 1 if another queue with this name already exists


.. code-block:: perl

     $Exist = $QueueObject->NameExistsCheck(
         Name => 'Some::Queue',
         ID   => 1,              # optional
     );





