Some PDIs are currently unavailable, and PDI actions are paused. View the latest updates here. Read More

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

patrickdeca
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

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

18 REPLIES 18

dasaana
Tera Contributor

Yes, this can be expected behavior. When a project is created from a template, the system may use a background process or different workflow that bypasses the standard insert business rule.

You can try using an after insert rule, workflow, or script trigger to ensure it fires even when the project is generated from a template.

RajveerSingh
Tera Expert

Yes, Business Rules generally fire when creating a project from a template because records are inserted into the database during template creation. However, if the script uses setWorkflow(false) or bypasses workflow processing, the Business Rules may not execute.

ajmalmuhamm
Tera Contributor

This is expected behavior. When a project is created from a template, the platform may use internal APIs or background processes that don't always execute business rules in the same way as a standard record insert. As a result, an Insert Business Rule on the Project table may not fire during project creation from a template. To confirm the behavior in your instance, you can enable Business Rule debugging or review the project creation process to see how the record is being created. If the rule is expected to run but consistently does not, it would be worth checking whether the creation process is bypassing business rules or using a different mechanism.

SoureshD6782072
Mega Expert

Complete Answer

Yes, this is expected behavior by design, not a defect.

When a project is created from a template, Project Portfolio Management/SPM uses specialized template-processing logic to create the project and its project tasks. During this process, normal insert Business Rules are intentionally suppressed. ServiceNow designed it this way because a large project template can create many project tasks; running recalculation and other Business Rules for every inserted task could make template creation extremely slow or cause excessive processing. This behavior was confirmed by ServiceNow in the accepted solution to the original Community question.

 

That explains why:

 

The project record is inserted successfully.
A Business Rule configured on Insert with no condition does not execute.
The same Business Rule executes when a project is created manually.
Business Rule debugging may show display rules but not the expected before/after insert rule.

The underlying behavior is similar to inserting records with workflow processing disabled, such as through setWorkflow(false), which prevents Business Rules from running for that database operation.

Important distinction

This is not caused by the condition or order of the custom Business Rule. Even an active insert Business Rule with no condition can be skipped because the template engine deliberately suppresses Business Rule processing for the template-driven insert.

Therefore, changing the Business Rule from after to before, lowering its order, or removing its condition will not reliably solve the issue.

Recommended solution

Do not modify the out-of-box project-template scripts or attempt to force all Business Rules to run during template processing. Doing so could cause:

Repeated project scheduling and recalculation
Poor performance for large templates
Duplicate events or notifications
Partially created project structures
Upgrade and supportability issues

Instead, execute the required custom logic after the entire project has been created from the template.

The right implementation depends on what the Business Rule is doing.