1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
|
# --
# Kernel/Config/GenericAgent.pm - config file of generic agent
# Copyright (C) 2001-2004 Martin Edenhofer <martin+code@otrs.org>
# --
# $Id: GenericAgent.pm.examples,v 1.14 2004/02/18 22:40:44 martin Exp $
# --
# 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 http://www.gnu.org/licenses/gpl.txt.
# --
package Kernel::Config::GenericAgent;
use strict;
use vars qw($VERSION @ISA @EXPORT %Jobs);
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(%Jobs);
$VERSION = '$Revision: 1.14 $';
$VERSION =~ s/^\$.*:\W(.*)\W.+?$/$1/;
# -----------------------------------------------------------------------
# config options
# -----------------------------------------------------------------------
%Jobs = (
# --
# [name of job] -> close all tickets in queue spam
# --
'close spam' => {
# get all tickets with these 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!',
},
},
},
# --
# [name of job] -> close and delete all tickets in queue delete
# --
'delete' => {
# get all tickets with these properties
Queue => 'delete',
States => ['new', 'open'],
Locks => ['unlock'],
# tickets older then 60 minutes
TicketCreateTimeOlderMinutes => 60,
# new ticket properties (no option is required,
# use just the options which should be changed!)
New => {
# DELETE!
Delete => 1,
},
},
# --
# [name of job] -> move all tickets from tricky to experts
# --
'move tickets from tricky to experts' => {
# get all tickets with these properties
Queue => ['tricky', 'tricky1'],
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
},
},
},
# --
# [name of job] -> send escalation notifications
# --
'send escalation notifications' => {
Escalation => 1,
# new ticket properties
New => {
Module => 'Kernel::System::GenericAgent::NotifyAgentGroupOfCustomQueue',
},
},
# --
# [name of job] -> move all tickets from xyz to experts
# --
'move escalation ticket to experts and execute CMD' => {
# get all tickets with these 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',
},
},
# --
# [name of job] -> move all tickets from abc to experts and change priority
# --
'move all priority "3 normal" tickets from abc to experts and set priority to "4 high"' => {
# get all tickets with these properties
Queue => 'abc',
Priorities => ['3 normal'],
# new ticket properties
New => {
Queue => 'experts',
Priority => '4 high',
TicketFreeKey1 => 'ProductSkill',
TicketFreeText1 => 'Expert required!',
},
},
# --
# [name of job] -> delete all tickets with subject 'VIRUS 32' in queue abc
# (take care if you use From, To, Cc, Subject or Body because it takes
# database performance!)
# --
'delete all tickets with subject "VIRUS 32" in queue abc' => {
# get all tickets with these properties
Queue => 'abc',
# From => '%Feedback%',
# To => '%Feedback%',
# Cc => '%Feedback%',
Subject => '%VIRUS%',
# Body => '%installing%',
# new ticket properties
New => {
# DELETE!
Delete => 1,
},
},
# --
);
# -----------------------------------------------------------------------
# end of config options
# -----------------------------------------------------------------------
1;
|