How to change a field value through step "Run Server Script" within ATF.

Vikas5
Kilo Explorer

I am creating one incident record through ATF, now i want to update one of the field value from test step "Run Server Script", i am using below mentioned script but its not working, please suggest if this is actually possible to do or not.

If i will try to update those incident fields then i would be using background script or fix script but in ATF i not getting the right approve to achieve the same. 

 

(function(outputs, steps, stepResult, assertEqual) {
var gr = new GlideRecord('x_amex_sourcing_request_request');
gr.get(steps('39f955d31b0f81906f82ca6b234bcb48').record_id);
gr.query();
if(gr.next()){
gr.x_amex_sr_si_service_description = 'Testing by vikas000';

gr.update();
}

2 REPLIES 2

Matt102
Giga Guru

HI,

Not what you asked, but thought it worth a mention. For what you are doing could you not use:
Test Step: Form (|| 'Forms in Service Portal') > 'Set Field Values' (SP)

or

Test Step: Server > Record Update

atb,matt

If scripting could you use:

gr.setValue('x_amex_sr_si_service_description','Testing by vikas000');

hth,matt