Courseiva

Why Your Business Rule Isn't Updating the Configuration Item

A ServiceNow instance has a business rule named 'Update CI Status' that runs on the 'Change Request' table after insert. The rule is intended to update the 'Configuration Item' record's 'Operational Status' to 'Under Maintenance' when a change request is created. The business rule uses the following script:

(function executeRule(current, previous != null)) {

var gr = new GlideRecord('cmdb_ci');

gr.get(current.cmdb_ci); gr.operational_status = 'Under Maintenance'; gr.update();

})(current, previous);

After a recent upgrade to the Vancouver release, the business rule stopped working. The change request is created successfully, but the CI's operational status remains unchanged. The system logs show no errors. What is the most likely cause and the correct fix?

A. The business rule is running asynchronously; change it to synchronous. B. The condition field is empty; add 'gs.action() === 'insert'' as the condition. C. The 'current.cmdb_ci' field is not populated; check that the field is required on the form. D. The script uses 'previous' incorrectly; remove 'previous != null' from the function signature.

Quick Answer

The answer is C, because the business rule fails to update the CI when the cmdb_ci field on the change request is empty, causing the GlideRecord get() method to return false silently. The script assumes current.cmdb_ci holds a valid sys_id, but if the field is not required on the form, a user can submit a change request without selecting a CI, leaving the variable null or undefined. This is a common trap on the ServiceNow Certified Application Developer CAD exam, which tests your understanding of data dependencies in business rules—specifically that a script will not throw an error if a GlideRecord get() fails; it simply does nothing. The Vancouver upgrade may have changed field behavior or form layout, but the root cause is the missing CI reference, not the script’s execution mode or condition. To remember this, think: “No CI, no update—always validate your reference fields before calling get().”

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

The script uses 'previous' incorrectly; remove 'previous != null' from the function signature.

The business rule contains a syntax error in the function signature. The correct format for a business rule script is `(function executeRule(current, previous))`. The script uses `(function executeRule(current, previous != null))` which is invalid JavaScript and prevents the script from executing. Since the script never runs, no error appears in the logs, and the CI is not updated. Option A is incorrect because changing to synchronous does not fix a syntax error. Option B is incorrect because the condition field being empty means the rule runs, but the script still fails to execute. Option C addresses a possible data issue, but the primary cause is the syntax error; even if `cmdb_ci` is populated, the script would still not run.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • The condition field is empty; add 'gs.action() === 'insert'' as the condition.

    Why it's wrong here

    Asynchronous vs synchronous does not affect script compilation; the script contains a syntax error that would prevent execution regardless.

  • The business rule is running asynchronously; change it to synchronous.

    Why it's wrong here

    An empty condition field means the business rule runs on all inserts, but the script still fails to execute due to the invalid function signature.

  • The 'current.cmdb_ci' field is not populated; check that the field is required on the form.

    Why it's wrong here

    While an empty `cmdb_ci` field could cause the update to fail, the business rule never executes because of the syntax error, so the field value is irrelevant.

  • The script uses 'previous' incorrectly; remove 'previous != null' from the function signature.

    Why this is correct

    The script uses an invalid function signature with `previous != null`. Removing `!= null` corrects the syntax, allowing the script to run and update the CI.

About these practice questions

This SNOW-CAD question is part of Courseiva's 481-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on SNOW-CAD

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. Refer to the exhibit. The business rule is intended to update the CI's operational status when an incident is resolved. However, the CI is not being updated. What is the most likely reason?

medium
  • A.The business rule runs after the record is saved, so changes to the CI are not saved
  • B.The script does not include a condition to check if the CI belongs to the cmdb_ci_server table
  • C.The business rule runs synchronously, so it cannot update another record
  • D.The script uses gr.update() without checking if the CI record exists

Why B: The script uses `gr.get('cmdb_ci_server', current.cmdb_ci)` which only finds CI records of the 'cmdb_ci_server' table. If the CI belongs to a different class (e.g., 'cmdb_ci_router'), the query returns no record, so the update never occurs. Option B is correct because the script lacks a condition to verify the CI's table class. Option A is incorrect because business rules running after save can still update other records. Option C is false since synchronous rules can update other records. Option D is not the root cause; the `gr.update()` is present, but the problem is that the record is not found.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This SNOW-CAD practice question is part of Courseiva's free ServiceNow certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SNOW-CAD exam.