
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2024 07:48 AM
Hi,
Is it possible to click on the i for configuration item and open the record in ATF? Kindly help.
Regards
Suman P.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2024 11:10 AM
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));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2024 11:52 PM
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]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2024 12:14 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2024 11:10 AM
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));

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2024 06:49 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2024 10:05 AM - edited ‎04-10-2024 10:07 AM
Under AFT there is a section called Administration and under that is Step Configuration. Click on that then click new.
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.