Courseiva
Self-Service and AutomationhardMultiple ChoiceObjective-mapped

SNOW-CSA Self-Service and Automation Practice Question

Exhibit

Refer to the exhibit.

sys_script_include.js:

var ApprovalHelper = Class.create();
ApprovalHelper.prototype = {
    initialize: function() {},
    sendApproval: function(rec) {
        var user = gs.getUser();
        var gr = new GlideRecord('sysapproval_approver');
        gr.initialize();
        gr.sysapproval = rec.sys_id;
        gr.approver = user.getID();
        gr.insert();
    }
};

A developer writes the script include above to create an approval record. When the method is called from a business rule on the requested item table, the approval is created but assigned to the wrong user. What is the most likely cause?

⚠ Common exam trap

Watch out — candidates often assume `gs.getUser()` always returns the 'user' they think of as the approver, but in ServiceNow it returns the user running the script, which in a business rule is the user who triggered the rule, not the intended approval target.

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 method uses gs.getUser() which returns the current user running the script, not the intended approver

The script uses `gs.getUser()` to set the approver, which returns the user currently running the script (the system user or the user triggering the business rule), not the intended approver. In ServiceNow, `gs.getUser()` retrieves the session user, which in a business rule context is the user who triggered the rule, not necessarily the user who should approve the request. To assign the correct approver, the script should reference a field from the current record (e.g., `current.approver`) or use a specific user sys_id.

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 method should use 'new GlideRecord' instead of 'var gr'

    Why it's wrong here

    Variable declaration is fine.

  • The method uses gs.getUser() which returns the current user running the script, not the intended approver

    Why this is correct

    In a business rule, the current user is often the system, not the actual requestor.

  • The method is not using the correct GlideRecord table name

    Why it's wrong here

    The table name 'sysapproval_approver' is correct.

  • The method should call rec.update() after inserting the approval

    Why it's wrong here

    Not needed for the approval record.

About these practice questions

Courseiva writes every SNOW-CSA question from scratch — 504 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-CSA 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-CSA exam.