GlideImportSetTransformer is not working in ATF run script

chaitanya2948
Tera Contributor

Hi Team,

 

I am building the ATF test case new step configuration to check the data source run and data upload process, I used the below script it is working on the background script but ATF it is not working, any suggestion would be helpful.

Error: Javascript compiler exception: Java constructor for "com.glide.system_import_set.ImportSet" with arguments "" not found. (null.null.script; line 4) in:

Script : 

var transformMapIDs = '99f45085db5785506616a05605961957';
var dataSource = new GlideRecord('sys_data_source');
dataSource.initialize();
// Append date/time to name of data source for audit.
dataSource.name = "Bulk cost center - "+current.number;
dataSource.import_set_table_name = "u_bulkupload_cost_center";
dataSource.import_set_table_label = "Bulkupload Cost centers";
dataSource.type= "File";
dataSource.format = "Excel";
dataSource.file_retrieval_method = "Attachment";
dataSource.header_row = "1";
dataSource.sheet_number = "1";
var dataSourceID=dataSource.insert();
//Copy the attachment to Data source
GlideSysAttachment.copy('sc_req_item', current.sys_id,'sys_data_source',dataSourceID);

// Assuming you've already created the data source and transform map as shown in your initial code snippet

// Run the data source
var importSet = new GlideImportSet();
importSet.initialize("da3c9bc697ee611033c4f9271153af6a");
var importSetId = importSet.runImportSet();

// Wait for the data source import to complete (optional)
var importSetStatus = new GlideImportSetStatus(importSetId);
while (!importSetStatus.isComplete()) {
gs.sleep(5000); // Wait for 5 seconds before checking again
importSetStatus = new GlideImportSetStatus(importSetId);
}

// Run the transform map
var transformMap = new GlideTransformMap("c89d934a97ee611033c4f9271153af23"); // Replace mapID with your actual transform map's sys_id
transformMap.transformAllRecords();

 

1 REPLY 1

Shaqeel
Mega Sage

Hi @chaitanya2948 

 

Transform Map is not possible with ATF.

You can try some other approach.

 

Regrds

Shaqeel


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

Shaqeel