<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"># --
# Kernel/Config/GenericAgent.pm - config file of generic agent
# Copyright (C) 2001-2013 OTRS AG, http://otrs.org/
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

package Kernel::Config::GenericAgent;

use strict;
use warnings;
use utf8;

use vars qw(@ISA @EXPORT %Jobs);
require Exporter;
@ISA     = qw(Exporter);
@EXPORT  = qw(%Jobs);

# -----------------------------------------------------------------------
# config options
# -----------------------------------------------------------------------
%Jobs = (
    # --
    # [name of job] -&gt; close all tickets in queue spam
    # --
    'close spam' =&gt; {
        # get all tickets with these properties
        Queue =&gt; 'spam',
        States =&gt; ['new', 'open'],
        Locks =&gt; ['unlock'],
        # new ticket properties (no option is required,
        # use just the options which should be changed!)
        New =&gt; {
            # new queue
            Queue =&gt; 'spam',
            # possible states (closed successful|closed unsuccessful|open|new|removed)
            State =&gt; 'closed successful',
            # new ticket owner (if needed)
            Owner =&gt; 'root@localhost',
            # if you want to add a Note
            Note =&gt; {
                From =&gt; 'GenericAgent',
                Subject =&gt; 'spam!',
                Body =&gt; 'Closed by otrs.GenericAgent.pl because it is spam!',
            },
        },
    },
    # --
    # [name of job] -&gt; close and delete all tickets in queue delete
    # --
    'delete' =&gt; {
        # get all tickets with these properties
        Queue =&gt; 'delete',
        States =&gt; ['new', 'open'],
        Locks =&gt; ['unlock'],
        # tickets older then 60 minutes
        TicketCreateTimeOlderMinutes =&gt; 60,
        # new ticket properties (no option is required,
        # use just the options which should be changed!)
        New =&gt; {
            # DELETE!
            Delete =&gt; 1,
        },
    },
    # --
    # [name of job] -&gt; move all tickets from tricky to experts
    # --
    'move tickets from tricky to experts' =&gt; {
        # get all tickets with these properties
        Queue =&gt; ['tricky', 'tricky1'],
        States =&gt; ['new', 'open'],
        Locks =&gt; ['unlock'],
        # new ticket properties
        New =&gt; {
            Queue =&gt; 'experts',
            Note =&gt; {
                From =&gt; 'GenericAgent',
                Subject =&gt; 'Moved!',
                Body =&gt; 'Moved from "tricky" to "experts" because it was not possible to find a solution!',
                ArticleType =&gt; 'note-internal', # note-internal|note-external|note-report
            },
        },
    },
    # --
    # [name of job] -&gt; send escalation notifications
    # --
    'send escalation notifications' =&gt; {
        Escalation =&gt; 1,
        # new ticket properties
        New =&gt; {
            # notify all agents who selected the queue in "my queues/custom queues"
#            Module =&gt; 'Kernel::System::GenericAgent::NotifyAgentGroupOfCustomQueue',
            # notify all agents who can access the ticket with rw permissions
            Module =&gt; 'Kernel::System::GenericAgent::NotifyAgentGroupWithWritePermission',
        },
    },
    # --
    # [name of job] -&gt; move all tickets from xyz to experts
    # --
    'move escalation ticket to experts and execute CMD' =&gt; {
        # get all tickets with these properties
        Queue =&gt; 'xyz',
        Escalation =&gt; 1,
        # new ticket properties
        New =&gt; {
            Queue =&gt; '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 =&gt; '/path/to/your/program',
        },
    },
    # --
    # [name of job] -&gt; move all tickets from abc to experts and change priority, set dynamic field
    # --
    'move all priority "3 normal" tickets from abc to experts and set priority to "4 high"' =&gt; {
        # get all tickets with these properties
        Queue =&gt; 'abc',
        Priorities =&gt; ['3 normal'],
        # new ticket properties
        New =&gt; {
            Queue =&gt; 'experts',
            Priority =&gt; '4 high',
            DynamicField_ProductSkill =&gt; 'Expert required',
        },
    },
    # --
    # [name of job] -&gt; move specific tickets from abc to experts
    # --
    'move specific tickets from abc to experts' =&gt; {
        # only move tickets where:
        # Dynamic Field:
        #   NameX is exactly 123
        #   NameY is like admin (as admin, administrator or administrators
        # Queue is abc

        # get all tickets with these properties
        Queue =&gt; 'abc',
        DynamicField_NameX =&gt; {
            Equals =&gt; '123',
        },
        DynamicField_NameY =&gt; {
            Like =&gt; 'admin*',
        },
        Priorities =&gt; ['3 normal'],
        # new ticket properties
        New =&gt; {
            Queue =&gt; 'experts',
            Priority =&gt; '4 high',
            DynamicField_ProductSkill =&gt; 'Expert required',
        },
    },
    # --
    # [name of job] -&gt; 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' =&gt; {
        # get all tickets with these properties
        Queue =&gt; 'abc',
#        From =&gt; '%Feedback%',
#        To =&gt; '%Feedback%',
#        Cc =&gt; '%Feedback%',
        Subject =&gt; '%VIRUS%',
#        Body =&gt; '%installing%',
#        DynamicField_ProductSkill =&gt; {
#            Equals =&gt; 'Expert required',
#        },
        # new ticket properties
        New =&gt; {
            # DELETE!
            Delete =&gt; 1,
        },
    },
    # --
    # [name of job] -&gt; send reminder emails to agents
    # --
    'send reminder emails to agents' =&gt; {
        # get all tickets with these properties
        States =&gt; ['pending reminder'],
        TicketPendingTimeOlderMinutes =&gt; 10,
        # new ticket properties (no option is required,
        # use just the options which should be changed!)
        New =&gt; {
            # if you want to add a Note
            Note =&gt; {
                From =&gt; 'Reminder Admin',
                Subject =&gt; 'Reminder Notification',
                Body =&gt; 'The reminder time of this ticket has been reached!',
            },
        },
    },
    # --
);

# -----------------------------------------------------------------------
# end of config options
# -----------------------------------------------------------------------

1;
</pre></body></html>