Processing tickets require often a workflow. Let’s say “if-then” activities.
If specific conditions match like:
-
A ticket is from one particular customer.
-
A ticket is assigned to an appropriate queue.
-
A ticket has a defined priority.
-
A ticket contains defined keywords.
Outlined activities must be performed like changing the ticket priority, moving the ticket to another group, assigning a service to a ticket, and many more.
Also time-based activities can be required like cleaning up the spam-queue once a week.
OTRS supports this with the Generic Agent. Here, simple or compound time and event-based tasks are configurable in the OTRS front end without the requirement to learn a scripting language. Depending on search criteria, and time or event criteria, tickets will automatically be acted upon.
Use this screen to manage generic agent jobs in the system. A fresh OTRS installation contains no generic agent jobs by default. The generic agent job management screen is available in the Generic Agent module of the Processes & Automation group.

Manage Generic Agent Jobs
To create a new generic agent job:
-
Click on the Add Job button in the left sidebar.
-
Fill in the required fields.
-
Click on the Save button.

To edit a generic agent job:
-
Click on a generic agent job in the list of generic agent jobs.
-
Modify the fields.
-
Click on the Save or Save and finish button.

To delete a generic agent job:
-
Click on the trash icon in the fourth column of the overview table.
-
Click on the Confirm button.

Note
If several generic agent jobs are added to the system, use the filter box to find a particular generic agent job by just typing the name to filter.
Warning
The maximum number of 30 valid generic agent jobs should not be exceeded. Exceeding this limit may affect the system performance.
To test a generic agent job before enabling automatic execution:
-
Set the job to Valid and save it.
-
Click on Run this task in the job overview list.
-
Review the results screen to verify which tickets were affected and what changes were made.
-
Adjust the job settings if necessary before activating the schedule or event triggers.
Note
The Run this task link is only visible for jobs that are set to Valid.
Generic Agent Job Settings
The following settings are available when adding or editing this resource. The fields marked with an asterisk are mandatory.
General Job Settings

- Job Name *
-
The name of this resource. Any type of characters can be entered to this field including uppercase letters and spaces. The name will be displayed in the overview table. A job can be renamed after creation.
- Validity
-
Set the validity of this resource. This resource can be used in OTRS only, if this field is set to Yes. Setting this field to No will disable the use of the resource.
Automatic Execution
Fill in this section to set the times for automatic execution of the job.

The job fires at every combination of selected minutes, hours, and days. At least one value must be selected in each of the three fields for the automatic schedule to be active. If any field is left empty, a warning is displayed and the job will not run on a schedule.
- Schedule minutes
-
Select the minutes in which the job has to be executed. For example if 10 is selected, the job will be executed in every hour in 00:10, 01:10, 02:10, etc.
Warning
The automatic execution should not be performed more than one per hour. Exceeding this limit may affect your system performance.
- Schedule hours
-
Select the hours in which the job has to be executed. For example if 10 is selected for minutes and 03 is selected for hours, the job will be executed in every day in 03:10.
- Schedule days
-
Select the days in which the job has to be executed. For example if 10 is selected for minutes, 03 is selected for hours and Fri is selected for days, the job will be executed in every week in Friday 03:10.
Note
Scheduled tasks are using the local system time provided by the operating system OTRS is running on.
Warning
Times scheduled during daylight saving time start and daylight saving time end can have unexpected effects. At daylight saving time start it can be skipped and at daylight saving time end it can be executed twice. It is highly not recommended to schedule times when the daylight saving time starts or ends according to the server timezone.
Event Based Execution
Fill in this section to set events that trigger the execution of the job. A job may have both a schedule and event triggers — they run independently of each other.
An event trigger watches for a specific change to a ticket, such as the ticket being moved to a different queue or a new article being added. When that change occurs, the job runs automatically.

- Event Triggers
-
This is a list of already added events. If no events are added yet, the list contains no elements. Elements can be deleted by clicking on the trash icon in the last column.
Each event trigger has an All Tickets checkbox:
-
When unchecked (default), the job acts only on the specific ticket that fired the event.
-
When checked, the job ignores the triggering ticket and instead runs the Select Tickets filter, processing all matching tickets — the same behavior as a scheduled run, but initiated by the event.
-
- Add Event Trigger
-
Select an object and a related event that will trigger the job. Available event types include Ticket, Article, and Session. Additional types may be present depending on which features are active in the system.
Common ticket events:
Event
When it fires
TicketCreateA new ticket is created.
TicketQueueUpdateA ticket is moved to a different queue.
TicketStateUpdateA ticket’s state changes.
TicketPriorityUpdateA ticket’s priority changes.
TicketOwnerUpdateA ticket’s owner changes.
TicketLockUpdateA ticket is locked or unlocked.
ArticleCreateA new article (email, note, phone call, etc.) is added.
- Event execution
-
Controls whether the job runs immediately or in the background when an event fires.
- Instant (may block screen)
-
The job runs synchronously as part of the same action that triggered the event. The agent’s screen may be briefly delayed while the job completes. This is the default.
- Daemon
-
The job is handed off to the OTRS background service and runs asynchronously. The agent’s screen responds immediately without waiting.
Use Daemon when the job could match a large number of tickets, or when the job performs heavy processing such as Ticket Allocation calculations.
Note
When the same event fires for several tickets at once, each ticket gets its own separate background task. Tasks for different tickets can run in parallel, but at most one task per job and ticket combination is queued at any time. The order in which tasks for different tickets run is not guaranteed.
- Prevent infinite loops
-
An infinite loop can occur when a job’s action re-fires the same event that triggered it. For example: a job that listens to queue changed and then moves the ticket to a different queue will re-fire queue changed, which would trigger the job again.
- No
-
No protection. If the job’s action re-fires its own trigger event, the job will run again. This is the default for backward compatibility.
- Yes
-
The system records that this job is already processing this ticket and event combination. If the same combination is seen again before the current run finishes, the second execution is silently skipped.
Enable this setting for any event-triggered job whose actions could re-fire the same event on the same ticket. The protection record expires after 10 minutes. This protection works for both Instant and Daemon execution modes.
Note
This protection is per job. Two different jobs listening to the same event can each still run once — they do not block each other.
Warning
Misconfiguration of event-triggered jobs, especially when Prevent infinite loops is set to No, can lead to repeated or infinite execution loops that degrade system performance.
Select Tickets
This section contains all the attributes that you can use to select the affected tickets. All fields are optional. Leaving all fields empty matches all tickets in the system, subject to the processing limit.
Multiple values selected within one field match tickets that have any of those values (OR). Using multiple fields requires a ticket to match all of them (AND).
Warning
A single job run will process at most 4000 tickets by default. If the filter matches more tickets, the remaining tickets are skipped in that run. A warning is shown on the results screen when this limit is reached. The limit can be changed via the Ticket::GenericAgentRunLimit system configuration setting.
Dynamic fields of type attachment could be used only in this section. However, it is not updatable by generic agent and this type of dynamic fields are not listed in Update/Add Ticket Attributes section.
Extended search conditions can be used for some fields and the possible syntaxes are:
|
Syntax |
Description |
|---|---|
|
|
exact search |
|
|
wildcard |
|
|
wildcard |
|
|
or |
|
|
and |
|
|
negation (not) |
Here are some examples for extended searches in the ticket title:
|
Entry in Title Field |
Search Result |
|---|---|
|
|
Finds tickets where the title is foo. |
|
|
Finds tickets with exactly this string (including the space). |
|
|
Finds tickets where the title starts with foo. |
|
|
Finds tickets where the title ends with bar. |
|
|
Finds tickets where the title contains foo. |
|
|
Finds tickets where the title is foo or bar. |
|
|
Finds tickets where the title contains foo or bar. |
|
|
Finds tickets where the title contains foo and bar. |
|
|
Finds tickets where the title contains foo and not bar. |
|
|
Finds tickets where the title contains foo and it is not foobar. |
The time filter fields (Create times, Last changed times, Change times, Last close times, Close times, Pending times, Escalation times) each offer three options:
-
No settings — this dimension is not used as a filter.
-
Relative time window — matches tickets where the event falls within a window relative to now. Set a direction (within the last, within the next, or more than … ago), a number (1–60), and a unit (minutes, hours, days, weeks, months, or years).
-
Between two dates — matches tickets where the event falls between two specific dates.
Update/Add Ticket Attributes
Fill in this section to update and/or add ticket attributes. All fields are optional — leave a field empty to leave that attribute unchanged.
Dynamic fields of type date or date and time can be set to absolute, relative or no date. The values can be positive like +5 days or negative like -10 hours based on the current time.
Dynamic fields of type attachment are not listed in this section.

- Pending date
-
Sets a pending reminder time relative to the moment the job runs. Enter a number and select a unit (minutes, hours, days, months, or years). For example, entering 2 with day(s) sets the reminder to 2 days from now.
Note
The pending time is only applied when the new state set by this job is a pending state, or — if no new state is configured — when the ticket is already in a pending state. If neither condition is true, this field has no effect.
All other fields in this section are self-explanatory.
Add Note
Fill in this section to add a note to tickets that are affected by job execution.

Note
A note is only created when the Text field contains content. Filling in From or Subject without providing a body text will not create a note.
- From
-
The sender name shown in the note. Defaults to GenericAgent if left empty.
- Subject
-
The note subject line. Defaults to Note if left empty.
- Text
-
The note body. This field must be filled for the note to be created. Maximum 200 characters.
- Visible to customer
-
When unchecked (default), the note is internal and only visible to agents. When checked, the note is visible to the customer.
- Time units
-
Time to book against the ticket for time accounting purposes.
Execute Ticket Commands
Fill in this section, if you would like to execute a command or delete tickets with the job.

- Send agent/customer notifications on changes
-
If Yes is selected (default), notifications are sent to agents and customers about ticket changes according to the configured notification rules. If No is selected, all notifications for changes made by this job are suppressed.
- CMD
-
Enter a command here, that will be executed. ARG[0] will be the ticket number. ARG[1] the ticket ID. Use
::as directory separator, if the value contains a path.See also
Commands to be run by OTRS are blocked by default due to security reasons. You have to add the command to the allow list as described in Allow Program Safe to Run chapter.
Note
This feature is only available to On-Premise customers. If you are a Managed customer, this feature is taken care of by the Customer Solutions Team in OTRS. Please contact us via support@otrs.com or in the OTRS Portal.
- Delete tickets
-
If Yes is selected, the generic agent job will delete the matched tickets.
Warning
All affected tickets will be removed from the database and cannot be restored!
Execute Custom Modules
Note
This feature is only available to On-Premise customers. If you are a Managed customer, this feature is taken care of by the Customer Solutions Team in OTRS. Please contact us via support@otrs.com or in the OTRS Portal.
Fill in this section to execute a custom module with the job, or to use a specialized ordering or pre-action module.

- Order module
-
A module that receives the full list of matched tickets and returns them in a custom processing order. The job then processes tickets in that order. If the module returns no result, the job falls back to processing tickets in ascending ticket ID order and logs an error.
This module runs for both scheduled and event-triggered job executions.
The built-in option Ticket Allocation sorts tickets according to Ticket Allocation priority rules (queue priorities, service-time constraints, maximum tickets per queue) so that the most urgent tickets are processed first. Leave this field empty if you are not using Ticket Allocation.
- Pre action module
-
A module that runs once per matched ticket, before the configured ticket actions are applied. It can modify which actions are taken on that specific ticket — for example, dynamically determining which agent should be assigned based on current workload. If the module returns no result or encounters an error, the original configured actions are used unchanged as a fallback and an error is logged.
This module runs for both scheduled and event-triggered job executions.
Warning
Ticket actions configured in this job may be overwritten by this module.
The built-in option Ticket Allocation automatically determines the right agent for each ticket based on availability, workload, group permissions, and optionally agent competences. Leave this field empty if you are not using Ticket Allocation.
- Module
-
This is the path for a custom module to be executed once per matched ticket, after all other ticket attribute changes have been applied.
Note
Use
::as directory separator, if the value contains a path. - Param key
-
Enter the key of the parameter that should be passed to the module.
- Param value
-
Enter the value of the parameter that should be passed to the module. Up to six key/value parameter pairs can be defined. These parameters are injected into the job configuration before the module runs and will not overwrite any built-in job settings.
Execution Order Within a Job Run
When a job processes a ticket, actions are applied in the following sequence. This matters when combining multiple actions — for example, the note is created before the state changes, so it reflects the ticket state prior to any state update made by this job.
-
Pre action module (if configured).
-
Move to new queue.
-
Add note (if text body is set).
-
Change state and set pending time.
-
Set customer user / customer ID.
-
Change title.
-
Change type / service / SLA / priority.
-
Change owner / responsible / lock.
-
Update dynamic fields.
-
Apply archive flag.
-
Run custom module (Module field).
-
Run shell command (CMD field).
-
Delete ticket (if enabled — always last).
