ATF: Split task steps

jessa23
Tera Contributor

Dear All,

 

I am currently 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);

 

 

 

1 ACCEPTED SOLUTION

Hemant Goldar
Mega Sage
Mega Sage

Hi @jessa23 ,


Greeting!


Please try the below script

(function(outputs, steps, stepResult, assertEqual) {
  var gr = new GlideRecord('sn_vul_action_split_vg');
	gr.get(steps('27a02cb7973c7590481abce3f153afd7').first_record);// make sure provided sys_id of step associated with same test
		gr.setValue('new_vg_short_desc',' test split from the script');
		gr.update();
	
})(outputs, steps, stepResult, assertEqual);

 

I hope this helps!

 

Regards,

Hemant 

**Please mark the appropriate response as the correct answer and helpful, This may help other community users to follow the correct solution.**

View solution in original post

1 REPLY 1

Hemant Goldar
Mega Sage
Mega Sage

Hi @jessa23 ,


Greeting!


Please try the below script

(function(outputs, steps, stepResult, assertEqual) {
  var gr = new GlideRecord('sn_vul_action_split_vg');
	gr.get(steps('27a02cb7973c7590481abce3f153afd7').first_record);// make sure provided sys_id of step associated with same test
		gr.setValue('new_vg_short_desc',' test split from the script');
		gr.update();
	
})(outputs, steps, stepResult, assertEqual);

 

I hope this helps!

 

Regards,

Hemant 

**Please mark the appropriate response as the correct answer and helpful, This may help other community users to follow the correct solution.**