Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Is it possible to open this record in ATF

Community Alums
Not applicable

Hi,

Is it possible to click on the i for configuration item and open the record in ATF? Kindly help.

 

Configuration Item.PNG

 

Configuration Item 1.PNG

 

Regards

Suman P.

1 ACCEPTED SOLUTION

I created a custom test step that may be able to help with this. It requires 3 input values.

Filed Name: The filed you want to get from the record (In this test case it will be most likely cmdb_ci)
Table: What table the field is no (sn_vul_vulnerability_item)

Record: sys_id of the record you need to get the field from. (sys_id of the variability record you want the configuration item from)

 

Then there is one output value which in you case should have the sys_id of the configuration item field.

Note: That I have my output to return a string. You may need to change that to return a document id as the field to properly use this in future test steps. 

Below is the script in Step Execution script section.

(function executeStep(inputs, outputs, stepResult, timeout) {
	var tableName = inputs.u_table.toString();
	var recordID = inputs.u_record.toString();
	var fieldName = inputs.u_field_name.toString();
	
	var currentRecord = new GlideRecord(tableName);
	var recordFound = currentRecord.get(recordID);
	outputs.u_field_value = currentRecord[fieldName].toString();
	//gs.log('Problem Number: ' + outputs.u_field_value);
	
	stepResult.setSuccess(true);

}(inputs, outputs, stepResult, timeout));

View solution in original post

9 REPLIES 9

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Community Alums 

 

It is sys pop view, but what we will do after open this in ATF?

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Community Alums
Not applicable

Hi @Dr Atul G- LNG 

Please let me know if we can do this or no? I need to open the record and validate.

Regards

Suman P.

Hi @Community Alums 

 

No we cant open this. I tried this at my end.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Community Alums
Not applicable

Hi @Dr Atul G- LNG ,

Is there a way that I can open the configuration item record? sn_vul_vulnerable_item is the main record table. Now, I need to open the cmdb_ci table record from the main record. Is there a way I can do it? Kindly help.

 

Main table record will be dynamically selected.

Regards

Suman P.