- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2020 05:23 AM
Hi All,
I am working on import sets and transform maps. I wanted to load one excel sheet for loading in multiple tables.
This is for loading into test case and related test case steps instance
Under test plan I have to load test cases as first step and second I have to map to test case -> test case step
so from one excel sheet
test plan -> I have load test cases
test case -> to load its related test case steps.
How can achieve using one excel sheet. Any specific coding needed for this.
Thanks,
Lean S
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2020 05:24 AM
Hi,
From single excel file you can transform data to multiple target tables.
I assume you must be having a data source to which this excel would be attached
Define the transform maps accordingly in sequence with the Order for those target tables
1st load the Test Plan
2nd Load the Test case
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2020 09:56 AM
Okay.
In the green section (out of 4 columns in your XLS) is there any 1 column data unique which can help us to identify that record in SN to fetch the TC number?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2020 10:19 AM
Hi Asifnoor,
In the green section which I am loading into Test Case table (using TC_number (Is a test plan - name))
we can identify with TC_number i.e., test plan name which will be in test case table as reference
and Test Plan is the field name in TEST CASE STEPS table for TC_number
*** from test case table if possible we can Use Test Scenario field from Green section.
which will be using to sort
Thanks,
Lean S

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2020 11:20 AM
Hi
creating new thread.
Can you run this script in your background and share me the outtput. Based on this we can decide the source script.
var gr = new GlideRecord("tm_test_case_instance");
gr.addQuery("short_description","TEST ABC"); //put right value and field that is unique if this is not.
gr.query();
gs.info("No. of rows are "+gr.getRowCount());
if(gr.next()) {
gs.info("Sys id is "+gr.sys_id.toString()+"---"+gr.number);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2020 08:53 PM
Hi,
Thanks for that.
please find below:
I have used Test plan as reference in the code:
as I am using test plan name as reference and it is Short description field. so below code I used
var gr = new GlideRecord("tm_test_case_instance");
gr.addQuery("tm_test_plan.short_description","TEST ABC"); //put right value and field that is unique if this is not.
gr.query();
gs.info("No. of rows are "+gr.getRowCount());
if(gr.next()) {
gs.info("Sys id is "+gr.sys_id.toString()+"---"+gr.number);
}
output:
In the green coloured section, I used Test scenario also and below is the output:
var gr = new GlideRecord("tm_test_case_instance");
gr.addQuery("u_test_scenario","TCTEST "); //put right value and field that is unique if this is not.
gr.query();
gs.info("No. of rows are "+gr.getRowCount());
if(gr.next()) {
gs.info("Sys id is "+gr.sys_id.toString()+"---"+gr.number);
}
Output:
Thanks,
Lean S

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2020 11:13 PM
Hi
As per 1st output, we have 53 rows. so it is not unique through which we can identify a test case number.
In the 2nd output, we got 2 rows. Can you tell me if the test case number is same for these 2 rows or different?