- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2019 12:02 PM
Hi,
We are on London and started to build and implement ATF cases. I have created ATF for one of the catalog item.
I have fill out the form and created RITM and Catalog task. But I am not sure how to fill full filler supplied variables that
need to be completed before closing of task. I have researched and get to know that Server Side script must be used to
complete this process. So, I need help on script as I am new to this ATF. Help must be appreciated.
Thanks,
Sai
Solved! Go to Solution.
- Labels:
-
Automated Test Framework

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2019 10:28 PM
Try Below script.
var req = new GlideRecord('sc_req_item');
req.get(<sys_id of the ritm>);
req.variables.<variable_name> = <Value>;
req.update();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2019 10:28 PM
Try Below script.
var req = new GlideRecord('sc_req_item');
req.get(<sys_id of the ritm>);
req.variables.<variable_name> = <Value>;
req.update();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2019 10:47 PM
you do you need script? you can use
1.open an existing record step
2.set field values step
it is possible to fill the task values using the above steps.
OR use the below steps
var gr = new GlideRecord("sc_task");
gr.addQuery('request_item',steps(PREVIOUS_STEP_SYS_ID).record_id);
gr.query();
if(gr.next())
{
gr.description ="10.123.45.67";
gr.work_notes = 'test';
outputs.sys_id = gr.update();
}
replace PREVIOUS_STEP_SYS_ID with the sysid of your previous ATF step
-Satheesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2019 08:34 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2019 10:54 PM
Hi,
At the start of the script i.e. just after the function starts you need to define two variables:
var response; //for your result
var record_id; //to pass the result
after the GlideRecord you need to add the below step:
gr.addQuery('step','sys_id_of_the_previous_step');
gr.query();
The last two lines of the code before the function ends will be:
response= where you store the output;
outputs.record_id= response;
Hope this helps.
Please mark the answer correct/helpful.
Regards,
Soumita.