1

I am facing an issue in servicenow Business rules. I have 2 business rules which has to trigger when

  • When an incident created
  • When specific fields of an incident updated

While creating an incident I'm setting some default values say State - closed, Urgency - Low. I am expecting that it should only trigger create incident business rule but it's triggering update incident business rule as well to set Urgency and State values.

halfer
  • 18,701
  • 13
  • 79
  • 158
ImGenie
  • 293
  • 1
  • 14

1 Answers1

1

Are you using current.update() in your Business Rule that runs on insert? If so, that is probably triggering the second Business Rule to run.

Also, make sure your Business Rule is set as a before Business Rule instead of an after to help the flow if at all possible.

It's generally not necessary to call current.update() for a before Business Rule since these run before the actual insert happens.

Take a look at the best practices for Business Rules when you have some time https://hi.service-now.com/kb_view.do?sysparm_article=KB0540192

In particular this one may describe the behavior your are seeing.

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.

Kirk
  • 15,831
  • 19
  • 73
  • 105