Courseiva

SNOW-CAD Practice Question: Automating application logic with business rules and scripts

Exhibit

Business Rule: "Update CI on Incident Update"
Table: Incident
When: After update
Script:
(function executeRule(current, previous /*null when async*/) {
    if (current.state.changesTo('Resolved')) {
        var ci = current.cmdb_ci;
        if (ci) {
            var gr = new GlideRecord('cmdb_ci_server');
            gr.get(ci);
            gr.operational_status = 'In Use';
            gr.update();
        }
    }
})(current, previous);

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?

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 does not include a condition to check if the CI belongs to the cmdb_ci_server table

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.

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 business rule runs after the record is saved, so changes to the CI are not saved

    Why it's wrong here

    After rules can update other records; changes are saved.

  • The script does not include a condition to check if the CI belongs to the cmdb_ci_server table

    Why this is correct

    If the CI is not a server, the GlideRecord may fail to find it.

  • The business rule runs synchronously, so it cannot update another record

    Why it's wrong here

    Synchronous rules can update other records.

  • The script uses gr.update() without checking if the CI record exists

    Why it's wrong here

    While true, the most likely cause is the table mismatch.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

About these practice questions

Courseiva writes every SNOW-CAD question from scratch — 481 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.