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

Hi @Community Alums 

 

NO, bcz there is no option in ATF test step, which allow me to open the sys pop up view. Sorry for this.

 

You can open this record by going in cmdb table but not from main record.

*************************************************************************************************************
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]

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

ServiceNow Use6
Tera Guru

Hi @Brian Lancaster ,

I hope you are doing good. Kindly help me the way I can open the Configuration Item record after I open the Vulnerability Item record from sn_vul_vulnerability_item table.

Regards

Suman P.

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));

Community Alums
Not applicable

Hi @Brian Lancaster ,

I am very new to doing scripting in ATF. Please be patient an try to help me. I will always remember your help.

 

I have questions please.

1. Which kind of custom step is this?

2. Where would I create the inputs and outputs?

 

Regards

Suman P.

Under AFT there is a section called Administration and under that is Step Configuration. Click on that then click new.

BrianLancaster_0-1712768261942.png

Fill out the mandatory fields (for category I put mine under Server since it is a server side script). Past the script I gave you in the Step Execution script. Once you save the record you should see tabs below the script to setup the input and output values.

BrianLancaster_1-1712768580493.png

 

2024-04-10_10-03-23.png