Now we want to go through a few examples. There is also a example config file (Kernel/Config/GenericAgent.pm.examples).
Here all possible options:
'name of job' => { # get all tickets with these properties TicketNumber => '200%01', Queue => 'system queue', States => ['new', 'open'], Priorities => ['1 very low', '2 low', '3 normal'], Locks => ['unlock'], From => '%spam@example.com%', To => '%support@example.com%', Cc => '%client@example.com%', TicketFreeKey1 => 'Product', TicketFreeText1 => 'adasd', TicketFreeKey2 => 'Product', TicketFreeText2 => 'adasd', Subject => '%VIRUS 32%', Body => '%VIRUS 32%', CustomerID => '123', CustomerUserLogin => 'uid123', # tickets older the 60 minutes TicketCreateTimeOlderMinutes => 60, # tickets newer then 60 minutes TicketCreateTimeNewerMinutes => 60, # tickets with create time older then .... TicketCreateTimeOlderDate => '2004-01-19 00:00:01', # tickets with create time newer then ... TicketCreateTimeNewerDate => '2004-01-09 23:59:59', # or escalation tickets Escalation => 1, # new ticket properties (no option is required, use just the options # which should be changed!) New => { # new queue Queue => 'new system queue', # possible states (closed successful|closed unsuccessful|open|new|removed) State => 'closed successful', # new priority Priority => '3 normal', # new ticket free text TicketFreeKey1 => 'Product123', TicketFreeText1 => 'adasd123', # new ticket owner (if needed) Owner => 'root@localhost', # set customer id and customer user CustomerID => '123', CustomerUserLogin => 'usd213', # if you want to add a Note Note => { From => 'GenericAgent', Subject => 'Your subject!', Body => 'Some comment!', ArticleType => 'note-internal', # note-internal|note-external|note-report }, # your program (/path/to/your/program) will be executed like # "/path/to/your/program $TicketNumber $TicketID" ARG[0] will # be the ticket number and ARG[1] the ticket id CMD => '/path/to/your/program', # DELETE ticket from database and filesystem Delete => 1, }, |
If you get spam tickets in your system and you want spend much time on it, create a queue (named spam) and just move the spam tickets into this queue. If the bin/GenericAgent.pl runs, all open tickets in the queue spam will be closed by the bin/GenericAgent.pl.
Example for Kernel/Config/GenericAgent.pm
[...] # -- # [name of job] -> close all tickets in queue spam # -- 'close spam' => { # get all tickets with this properties Queue => 'spam', States => ['new', 'open'], Locks => ['unlock'], # new ticket properties (no option is required, use just the options # which should be changed!) New => { # new queue Queue => 'spam', # possible states (closed successful|closed unsuccessful|open|new|removed) State => 'closed successful', # new ticket owner (if needed) Owner => 'root@localhost', # if you want to add a Note Note => { From => 'GenericAgent', Subject => 'spam!', Body => 'Closed by GenericAgent.pl because it is spam!', }, }, }, [...] |
If you want to delete (means delete ticket from database and filesystem) a ticket from a queue use this.
Example for Kernel/Config/GenericAgent.pm
[...] # -- # [name of job] -> close and delete all tickets in queue delete # -- 'delete' => { # get all tickets with this properties Queue => 'delete', States => ['new', 'open'], Locks => ['unlock'], # new ticket properties (no option is required, use just the options # witch should be changed!) New => { # DELETE! Delete => 1, }, }, [...] |
Moved ticket from tricky to experts queue and add note.
Example for Kernel/Config/GenericAgent.pm
[...] # -- # [name of job] -> move all tickets from tricky to experts # -- 'move tickets from tricky to experts' => { # get all tickets with this properties Queue => 'tricky', States => ['new', 'open'], Locks => ['unlock'], # new ticket properties New => { Queue => 'experts', Note => { From => 'GenericAgent', Subject => 'Moved!', Body => 'Moved from "tricky" to "experts" because it was not possible to find a sollution!', ArticleType => 'note-internal', # note-internal|note-external|note-report }, }, }, [...] |
Send escalation notifications to agents which subscribed to the custom queue of the ticket.
Example for Kernel/Config/GenericAgent.pm
[...] # -- # [name of job] -> send escalation notifications # -- 'send escalation notifications' => { Escalation => 1, # new ticket properties New => { Module => 'Kernel::System::GenericAgent::NotifyAgentGroupOfCustomQueue', }, }, [...] |
Moved ticket from abc with priority "3 normal" to experts queue and change priority to "4 high".
Example for Kernel/Config/GenericAgent.pm
[...] # -- # [name of job] -> move all tickets from abc to experts and change priority # -- 'move all abc priority "3 normal" tickets to experts and change priority'=> { # get all tickets with this properties Queue => ['abc'], States => ['new', 'open'], Locks => ['unlock'], Priorities => ['3 normal'], # new ticket properties New => { Queue => 'experts', Priority => '4 high', TicketFreeKey1 => 'ProductSkill', TicketFreeText1 => 'Expert required!', }, }, [...] |
If there is a escalation ticket, move it to experts and execute a command.
Example for Kernel/Config/GenericAgent.pm
[...] # -- # [name of job] -> move all tickets from xyz to experts # -- 'move escalation ticket to experts and execute CMD' => { # get all tickets with this properties Queue => 'xyz', Escalation => 1, # new ticket properties New => { Queue => 'experts', # your program (/path/to/your/program) will be executed like # "/path/to/your/program $TicketNumber $TicketID" ARG[0] will # be the ticket number and ARG[1] the ticket id CMD => '/path/to/your/program', }, }, [...] |
Delete all tickets with subject "VIRUS 32" in queue abc.
Example for Kernel/Config/GenericAgent.pm
[...] 'delete all tickets with subject "VIRUS 32" in queue abc' => { # get all tickets with this properties Queue => 'abc', # From => '%spam@example.com%', # To => '%support@example.com%', # Cc => '%client@example.com%', Subject => '%VIRUS 32%', # Body => '%testing case 1245%', # new ticket properties New => { # DELETE! Delete => 1, }, }, [...] |