SNOW-CSA Self-Service and Automation • Set 2
SNOW-CSA Self-Service and Automation Practice Test 2 — 15 questions with explanations. Free, no signup.
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?
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();
}
};