2 条业务规则在事件创建时同时调用

2 Business Rules calling at the same time when incident created

我在 servicenow 业务规则中遇到问题。我有 2 个必须在

时触发的业务规则

在创建事件时,我设置了一些默认值,比如 状态 - 已关闭紧急程度 - 低。我预计它应该只触发 创建事件业务规则 但它会触发 更新事件业务规则 以及设置紧急性和状态值。

您是否在 插入 上 运行 的业务规则中使用了 current.update()?如果是这样,那可能会触发第二个业务规则 运行。

此外,确保您的业务规则设置为 before 业务规则而不是 after 以帮助流程(如果有的话)可能。

通常没有必要为 before 业务规则调用 current.update(),因为这些 运行 在实际 insert[=29 之前=] 发生了。

有空时看看业务规则的最佳实践https://hi.service-now.com/kb_view.do?sysparm_article=KB0540192

特别是这个可能描述了您所看到的行为。

Best Practice #2: Avoid using current.update() in before or after business rules. Avoid using current.update() to prevent recursions that impact system performance. The current.update() triggers business rules to run on the same table for insert and update operations. In a before or after business rule, this can lead to the rule calling itself over and over again.

It is unnecessary to use current.update() in a before business rule since these are saved automatically when the database is updated. After business rules are not intended to update current objects, so this is also not needed.

Unless there is a special case, avoid using current.update()since it not only stops business rules, but it also prevents the workflow engine from running on the record.