Run Server Side Script step in ATF is not filling the output value.

Michel
Tera Contributor

Hello, I am running a server side script step in ATF and test result is returning success but the issue is that the output variable is empty although i am filling it in the script and the result is not empty.

Can anyone tell me what's the issue?

NB: the response variable is declared in the configuration

 

find_real_file.png

find_real_file.png

9 REPLIES 9

Hi,

this line should be removed

outputs.u_response

why this is required?

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

i need to know the response i am getting. 

The thing is that i am trying to call an outbound api that will get data from a third party tool. so the result is the body message returned by the api and i need to put it in a response so i know the body message and check if the call returned the right data.

Hi Michel,

if you want to see the result in logs of ATF then use this

outputs.table = 'table name'; // such as incident
outputs.record_id = 'record sys_id'; // such as incident record sys_id

stepResult.setOutputMessage('Script include response'+result);

stepResult.setSuccess();

return true;

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur,

I really appreciate your help, but i need to fill the variables in the step result,

so the variable response needs to be filled the result in the step result.  

Hi Michel,

you should be able to see the output of the step when you use this line

stepResult.setOutputMessage('Script include response'+result);

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader