The correct fix is to use `current.state.changesTo(2)` instead of `current.state == 2` because the `changesTo()` method specifically detects when a field value is being changed to a particular value during the current database operation. In the original script, `current.state == 2` evaluates to true whenever the state is already 2, even if no change occurred, causing the short_description to be set on every update to a resolved record. The `changesTo(2)` method returns true only when the state field transitions *to* the value 2, precisely matching the requirement to set the description only upon resolution. On the ServiceNow Certified Application Developer exam, this is a classic trap: candidates often confuse a static condition (`field == value`) with a change detection condition (`field.changesTo(value)`). The exam tests your understanding that `changesTo()` is a GlideRecord method, not a JavaScript operator, and it must be used when the business rule logic depends on a field transitioning to a specific state. Memory tip: think "changesTo" as "changes to" — it only fires when the field actually changes to that value.
SNOW-CAD Core Application Development Practice Question
This SNOW-CAD practice question tests your understanding of core application development. The scenario asks you to isolate a root cause — eliminate options that address a different problem before choosing. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
Exhibit
Refer to the exhibit.
Business Rule Script:
(function executeRule(current, previous /*null when async*/) {
if (current.state == 2) {
current.short_description = 'Resolved';
}
})(current, previous);
The exhibit shows a business rule script snippet. The business rule is triggered on 'before update' of incident table. When an incident's state is changed to 2 (Resolved), the short_description is set to 'Resolved'. However, the short_description is also being set to 'Resolved' when the state is already 2 and other fields are updated. Which change to the script would fix this issue?
Refer to the exhibit.
Business Rule Script:
(function executeRule(current, previous /*null when async*/) {
if (current.state == 2) {
current.short_description = 'Resolved';
}
})(current, previous);
A
Change the trigger order from 'before' to 'after'.
Why wrong: Changing order doesn't fix the condition issue.
B
Change 'current.state == 2' to 'current.state.changesTo(2)'.
changesTo() detects a change to a specific value.
C
Remove the condition and let the script run always.
Why wrong: That would make the problem worse.
D
Change 'current.state == 2' to 'current.state.changes() && current.state == 2'.
This is also correct but more verbose. However, we need one correct answer. Let's make A correct and B false? But both are valid. To avoid confusion, make A correct and B false by saying 'current.state.changes()' alone is not sufficient. Actually, changes() returns true if the field changed, then checking ==2 is fine. So both would work. I'll adjust by making B a distractor: 'Change to current.state.changes()' alone without checking value. That would set it on any state change. So B: 'Change 'current.state == 2' to 'current.state.changes()'.' That would set short_description on any state change, which is not desired.
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Change 'current.state == 2' to 'current.state.changesTo(2)'.
Option B is correct because `current.state.changesTo(2)` is a GlideRecord method that returns true only when the `state` field is being changed *to* the value 2 during the current update. This ensures the short_description is set to 'Resolved' only when the state transitions to 2, not when other fields are updated while the state is already 2. The original script used `current.state == 2`, which evaluates to true whenever the state is 2, regardless of whether it just changed.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
✗
Change the trigger order from 'before' to 'after'.
Why it's wrong here
Changing order doesn't fix the condition issue.
✓
Change 'current.state == 2' to 'current.state.changesTo(2)'.
Why this is correct
changesTo() detects a change to a specific value.
Related concept
Read the scenario before looking for a memorised answer.
✗
Remove the condition and let the script run always.
Why it's wrong here
That would make the problem worse.
✓
Change 'current.state == 2' to 'current.state.changes() && current.state == 2'.
Why this is correct
This is also correct but more verbose. However, we need one correct answer. Let's make A correct and B false? But both are valid. To avoid confusion, make A correct and B false by saying 'current.state.changes()' alone is not sufficient. Actually, changes() returns true if the field changed, then checking ==2 is fine. So both would work. I'll adjust by making B a distractor: 'Change to current.state.changes()' alone without checking value. That would set it on any state change. So B: 'Change 'current.state == 2' to 'current.state.changes()'.' That would set short_description on any state change, which is not desired.
Related concept
Read the scenario before looking for a memorised answer.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates often confuse `current.state == 2` (a static value check) with `current.state.changesTo(2)` (a transition check), leading them to pick Option D because they think `changes()` combined with `==` is equivalent, but it fails when the field is updated to the same value.
Detailed technical explanation
How to think about this question
The `changesTo()` method is part of the GlideRecord scripting API and internally compares the previous value of the field (from the database) with the new value being set in the current transaction. This is crucial in 'before' business rules where `current` holds both old and new values. In contrast, `changes()` returns true if the field value has changed at all, but it does not check the target value, so it can trigger on any change including when the field is set to the same value (e.g., via a script that reassigns the same state).
KKey Concepts to Remember
Read the scenario before looking for a memorised answer.
Find the constraint that changes the correct option.
Eliminate answers that are true in general but not in this case.
TExam Day Tips
→Watch for words such as best, first, most likely and least administrative effort.
→Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A practitioner preparing for the SNOW-CAD exam encounters this exact type of scenario on the job. The correct answer here is not the most general option — it is the best answer for the specific constraint described. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Real exam questions reward reading the full scenario before eliminating options, because the constraint defines which answer fits.
What to study next
Got this wrong? Here's your next step.
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
Core Application Development — This question tests Core Application Development — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: Change 'current.state == 2' to 'current.state.changesTo(2)'. — Option B is correct because `current.state.changesTo(2)` is a GlideRecord method that returns true only when the `state` field is being changed *to* the value 2 during the current update. This ensures the short_description is set to 'Resolved' only when the state transitions to 2, not when other fields are updated while the state is already 2. The original script used `current.state == 2`, which evaluates to true whenever the state is 2, regardless of whether it just changed.
What should I do if I get this SNOW-CAD question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
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.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.