ATF can I fetch variable value (user) in run server site script to impersonate

Prathamesh Cha1
Tera Contributor

Following is the code I have written,

RITM is having that variable called v_brcl which has reference user

 

 

PrathameshCha1_0-1721633009174.png

PrathameshCha1_2-1721633177418.png

above is the field from RITM, which is submitted variable on the form.

 

1 REPLY 1

aman_sharma_07
Tera Guru

Hi @Prathamesh Cha1 !

 

I would suggest you have glide record query to fetch the respective RITM record and then try set it in the output.

(function(outputs, steps, params, stepResult, assertEqual) {
    // add test script here
var ritmId = steps(/*<sys_id of the step interacting with RITM record>*/).record_id;
var ritm = new GlideRecord("sc_req_item");
ritm.get(ritmId);
steps.outputs.record_id = ritm.variables.variable_name;
return true;
})(outputs, steps, params, stepResult, assertEqual);