Does business rules still fire when creating a project from template?

Patrick DeCarl1
ServiceNow Employee
ServiceNow Employee

I have a simple insert business rule with no condition on project table that doesn't get fired if user created a project from template. Is this by designed or bug?

1 ACCEPTED SOLUTION

arun_vydianatha
ServiceNow Employee
ServiceNow Employee

Hi Patrick



The BRs don't fire while creating projects from templates. The reason why we have turned off is - if template is too big, our recalculation BR fires on insert of each task and the whole system might end up spinning for lot of time.



So we had turned it off by design.



Thanks,


Arun


View solution in original post

11 REPLIES 11

danmjunqueira
Kilo Guru

This behavior is by design, not a bug — and it’s a well-known nuance of how ServiceNow handles project creation from templates.

When a user creates a project from a template in ServiceNow, the system uses Project Template Automation, which bypasses certain business rules — especially Insert business rules — during the initial population of the project and its related tasks. This is done to ensure performance, consistency, and controlled data population, because:

The creation process is scripted (usually via script includes, processors, or background scripts).

The insert operations are not user-initiated direct form submissions, but automated background logic.

To avoid recursion, circular logic, or duplicate logic execution, ServiceNow suppresses certain triggers during this process.


If you need logic to run even when projects are created from a template, here are your options:

1. Use a Business Rule on Insert AND Update
But ensure to add a custom condition or field check like:

current.operation() == 'insert' && current.created_from_template != true

2. Use a Script Include or Flow Logic
Modify the logic inside the template creation process (e.g., in ProjectTemplateTaskCreator or related script includes), and explicitly call your logic there.

3. Use a Flow Designer or Scheduled Job
Create a Flow that runs when a Project is created regardless of source, and apply your custom logic. Flows can sometimes detect background inserts more reliably.

4. Use onAfter Scripted Event
Sometimes using an after insert script or Event trigger can catch more automated actions.

If you share what your business rule does (e.g., setting a field, creating child records), I can help you relocate or re-trigger that logic appropriately.

Marcos Gianoni
Tera Contributor

The short answer is yes, Business Rules (BR) still fire when creating a project from a template in ServiceNow — but with a few important considerations.

When you create a project from a template, ServiceNow runs a series of backend operations. It creates the project record (pm_project) and can also generate tasks, milestones, child projects, and other related items, depending on how the template is configured.

Do Business Rules actually run?

Yes, as long as your BR is set to run on:

•When: before or after

•Insert and/or Update

Then it will execute as expected when the project and its related records are created from the template.

But here’s the catch:

The template engine typically uses GlideRecord operations or platform APIs to create records. Whether BRs run depends on how those operations are performed. For example:

•GlideRecord().insert() — ✅ BR fires.

•GlideRecord().update() — ✅ BR fires.

•GlideRecord().setWorkflow(false) — 🚫 disables BR, UI Policies, Flows, etc.

•GlideRecord().autoSysFields(false) — skips system fields like sys_created_by.

The good news is that when creating projects from templates, ServiceNow does not disable workflow processing by default, so Business Rules do fire normally for the project itself and all generated tasks or milestones.

 

Pro Tip:

If you have a Business Rule that should not run during template-based creation, you can add a condition in your script to check for certain fields like source_project (which typically indicates the record was created from a template).

Alternatively, use gs.isInteractive() to check if the action is happening through the UI versus being run by a script.

 

How to be sure if your BR is firing?

Enable Debug Business Rule in your instance:

Navigate to System Diagnostics > Debug Business Rule, then create a project from the template. You’ll see in the logs exactly which BRs are triggered and when.

So, bottom line: Yes, Business Rules do fire when creating a project from a template unless workflow is intentionally disabled in the process — which is not the default behavior in ServiceNow’s project creation logic.

 

If you want, I can even share a quick script example to test this! Just let me know. 😎