- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2023 06:54 AM - edited 08-31-2023 11:50 PM
Dear All,
I am creating ATF steps for splitting a remediation task but I have encountered some errors. It's either that my script doesn't open the table or it can't edit the short description of the record.
The previous step of this is a Record query of the remediation task I created.
What could be the reason the script is not working?
(function(outputs, steps, stepResult, assertEqual) {
var gr = new GlideRecord("sn_vul_action_split_vg");
gr.get(steps('27a02cb7973c7590481abce3f153afd7').first_record);
if (gr.next()){
gr.setValue('new_vg_short_desc','test split from script');
gr.update();
}
})(outputs, steps, stepResult, assertEqual);
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2023 05:57 PM - edited 08-31-2023 05:58 PM
Hello,
Use the following code instead.
//gr.get(steps('27a02cb7973c7590481abce3f153afd7').first_record);
if ( gr.get(steps('27a02cb7973c7590481abce3f153afd7').first_record) ){
gr.setValue('new_vg_short_desc','test split from script');
gr.update();
}
Looks like you can't do gr.next() because you are not making a gr.query().
Testing the returned value from gr.get() is enough.
Let me know how it works for you.
Philippe

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2023 05:57 PM - edited 08-31-2023 05:58 PM
Hello,
Use the following code instead.
//gr.get(steps('27a02cb7973c7590481abce3f153afd7').first_record);
if ( gr.get(steps('27a02cb7973c7590481abce3f153afd7').first_record) ){
gr.setValue('new_vg_short_desc','test split from script');
gr.update();
}
Looks like you can't do gr.next() because you are not making a gr.query().
Testing the returned value from gr.get() is enough.
Let me know how it works for you.
Philippe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2023 11:50 PM
Thank you very much, it worked!