Scheduled Tasks (Generic Agent)#
It’s very helpful to automatically perform tasks at any given time or when other actions occur within the system. The generic agent provides you with such flexibility.
Programming a generic agent to run a scheduled task is available via the web interface.
You must enter a name and an execution type.
Execution Types#
Scheduled
A scheduled task requires you to use the dropdown menus to enter the schedule in hour, minute, and day format. This will generally affect multiple tickets based upon the search criteria.
Event Based
An event based schedule is used when you want to catch an event within the system. For example when a ticket is created in order to trigger the generic agent. This will always affect just one ticket.
Filter Criteria#
The criteria entered in the next screen will be used to filter out the tickets which are affected.
Ticket Changes#
Here you can enter the changes which should be applied to the ticket or the tickets found.
Add a Note:
If you choose to do so, you can also make a note to the ticket.
Ticket Commands#
You can perform two different commands on a ticket that has been found.
Delete a Ticket#
Using the generic agent is one way to delete tickets within the system.
Important
Please use with care as this is a permanent deletion. There is no recovery option and no dedicated logging of this action.
Inform Agents of Changes#
Here you can deactivate agent notifications upon changes to tickets.
Execute Commands#
Note
The entered parameters can be called by their name $Param{New}->{'Test2'}
as given to get the value, or you can use $Param{New}->{'ParamKey2'}
or $Param{New}->{'ParamKeyValue2'}
. Basic parameters can be used by your script by using $Param{'TicketID'}
. You can additionally access other search and result parameters. As the system is highly extensible, there is no exhaustive list available.
Changed in version 6.3.
The possibility to execute system command (CMD) was removed for security reasons. If you still require this functionality it is possible with a custom generic agent module. There is an example module which replaces the CMD function located at Kernel/System/GenericAgent/SystemCommandExecution.pm.dist
. Use this file as a template and copy it. Don’t forget to change the package Kernel::System::GenericAgent::SystemCommandExecution;`
to match the name of the copied file. This file can be used then multiple times.
Example Module
Example Parameters Available for Use:
Important
A generic agent only processes 4000 tickets per run! This can be modified in Daemon::SchedulerGenericAgentTaskManager::TicketLimit
.