- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2016 08:42 AM
I am making a REST call and populating an Import Set table with the information retrieved. I have to hard code the Import Set sys id into the script to ensure that the data retrieved is added to the Import Set. The problem I have is that when the Scheduled Cleanup Import Set Deleter job runs it deletes my Import Set how can I exclude it?
var r = new sn_ws.RESTMessageV2('SL_DEVICE_API2', 'get');
var response = r.execute();
var jsonString = response.getBody();
var parser = new JSONParser();
var parsed = parser.parse(jsonString);
var rec = new GlideRecord('u_import_em7_records');
for(var key in parsed.result_set) {
var value = parsed.result_set[key];
rec.initialize();
rec.u_name = value.name;
rec.u_ip = value.ip;
rec.u_organization = value.organization;
rec.u_class_type = value.class_type;
rec.u_did = key.replace("/api/device/","");
rec.sys_import_set = '68212c6013771600220fb86f3244b0a7';
rec.insert();
Solved! Go to Solution.
- Labels:
-
Integrations
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2016 10:52 AM
Just to give an update on this I found the fix for this I do not know how I overlooked it before. I did not need to hard code the sys_id of the Import Set since whenever the scheduled job would run it would create a new Import Set. It would set the mode to Synchronous which would cause the transform to run right away.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2016 08:44 AM
Hi Bobby,
In that case you have to customize script include - ImportSetCleaner to exclude the import set you want.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2016 08:52 AM
FYI - this is an OOB script include so modifications carry with it the standard disclaimer "Once you modify it, you own it."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2016 09:21 AM
I guess I have to open a ticket with Hi support to see what my options are then.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2016 10:52 AM
Just to give an update on this I found the fix for this I do not know how I overlooked it before. I did not need to hard code the sys_id of the Import Set since whenever the scheduled job would run it would create a new Import Set. It would set the mode to Synchronous which would cause the transform to run right away.