自动任务¶
处理工单通常需要工作流程。我们称之为 “if-then” 活动。
If
指定匹配条件,比如:
- 工单来自一个特定客户。
- 工单分配到一个适当的队列。
- 工单有一个定义的优先级。
- 一个工单包含有定义的关键词。
必须执行一些概述的活动,如更改工单优先级、将工单移动到其他组、为工单分配服务等。
此外,还需要执行一些基于时间的活动,例如每周清理一次垃圾邮件队列。
OTRS使用 自动任务 支持此功能。 可以在OTRS前端配置一些简单任务或基于时间和事件的复合任务,而无需学习脚本语言。 根据搜索条件、时间或事件标准,自动对工单进行操作。
使用此屏幕可管理系统中的自动任务作业。 默认情况下,新的OTRS安装不包含任何自动任务作业。 自动任务作业管理屏幕位于 流程和自动化 组的 自动任务 模块中。

自动任务管理屏幕
管理自动任务¶
若要创建一个新的自动任务:
- 点击左侧边栏的 添加任务 按钮。
- 填写必填字段。
- 点击 保存 按钮。

创建新的自动任务屏幕
若要编辑一个自动任务:
- 点击自动任务列表中的一个自动任务。
- 修改字段。
- 点击 保存 或 保存并完成 按钮。

编辑自动任务屏幕
若要删除一个自动任务:
- 点击概览表第4列的垃圾桶图标。
- 点击 确认 按钮。

删除自动任务屏幕
注解
如果将多个自动任务添加到系统,请使用筛选框通过键入要筛选的名称来查找特定的自动任务。
警告
The maximum number of 30 valid generic agent jobs should not be exceeded. Exceeding this limit may affect the system performance.
自动任务设置¶
添加或编辑此资源时,可以使用以下设置。 标有星号的字段是必填字段。
通用的任务设置¶

任务设置 - 通用
- 任务名称 *
- 此资源的名称。 可以在此字段中输入任何类型的字符,包括大写字母和空格。 名称将显示在概览表中。
- 有效性
- 设置此资源的有效性。 如果此字段设置为 Yes/是,则此资源可用于OTRS。 将此字段设置为 No/否 将禁用资源的使用。
自动执行¶
填写此部分以设置自动执行任务的时间。

任务设置 - 自动执行
- 计划的分钟
选择执行任务的分钟数。 例如,如果选择 10,则任务将在 00:10、 01:10、 02:10 等每小时执行一次。
警告
The automatic execution should not be performed more than one per hour. Exceeding this limit may affect your system performance.
- 计划的小时
- 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.
- 计划的天
- 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.
注解
Scheduled tasks are using the local system time provided by the operating system OTRS is running on.
警告
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.
基于事件执行¶
填写此部分以设置触发执行任务的事件。

任务设置 - 基于事件执行
- 事件触发器
- 这是已添加的事件列表。 如果尚未添加任何事件,则列表不包含任何元素。 单击最后一列中的垃圾桶图标可以删除元素。
- 添加事件触发器
- 选择将触发任务的对象和相关事件。
执行工单指令¶
如果您想使用该任务执行自定义命令,请填写此部分。

任务设置 - 执行工单指令
- 给服务人员/客户发送通知
- 如果选择了 Yes/是,则会向服务人员和客户发送有关工单更改的通知。
- 命令
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.参见
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.
注解
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.
- 删除工单
如果选择了 Yes/是,则自动任务将删除匹配的工单。
警告
所有受影响的工单将从数据库中删除,无法恢复!
执行定制模块¶
注解
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.
如果您想在该任务执行自定义模块,请填写此部分。

任务设置 - 执行自定义模块
- 模块
这是模块执行的路径。
注解
如果值包含路径,请使用
::
作为目录分隔符。- 参数 键
- 输入应传递给模块的参数的键。
- 参数 值
- 输入应传递给模块的参数的值。