
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2014 09:17 AM
Hi everyone,
We are working exclusively with the Discovery tool, and our progress is coming nicely. However, I am having trouble with a report that I've created on the Configuration Item table that is designed to show all of the CIs that have been created by or updated by Discovery in the past X hours. The goal of the report is to display only CIs created or updated by Discovery, while CIs that have been created or updated by any other source should not be shown. While experimenting with this report, I have become curious as to the logic behind the how the "Discovery Source" field is populated.
As the Discovery tool is our only source of such activity, I would expect that each CI created or updated by Discovery to have a value of "Service-now" in the "Discovery Source" field. However, I see that the "Discovery Source" field appears to be empty for many of the records returned in this report.
To dig deeper, I added a filter to the report that says "Updated by" is "the account carrying out the discovery activity". Using this logic, only CIs that have been updated by Discovery should be returned, and the "Discovery Source" field should contain "Service-now" for all records. However, the "Discovery Source" field appears to be empty for the majority of the nearly 40,000 records returned by this report.
If I add an additional filter of "Discovery Source" is not "Service-now", 0 records are returned. All of this experimenting leads me to the question: Is there any reason why the "Discovery Source" field would be empty for some records in this report, when it must actually contain a value of "Service-now"?
Any help would be very much appreciated!
Solved! Go to Solution.
- Labels:
-
Discovery
-
Service Mapping

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2014 05:50 PM
Transform maps and import sets are not used to set discovery values. You need to look at the sensor scripts in the discovery application to modify data mappings.
Regarding the discovery_source field, that is set in script includes. Here are some that set this value: https://[your_instance_name].service-now.com/sys_script_include_list.do?sysparm_query=scriptLIKEdisc...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2014 11:32 AM
Your current transform map might not be setting this value.
Also, Discovery source field is a choice list that feeds from the Choice Lists table, so maybe the transform map is trying to add the source, but the value might not match the "value" for the option (so maybe a value-label issue).
Also, the transform map might be setting the Discovery source for computers, but maybe not for Software installations, Disks or Network devices, other CI's popularly imported in these roll outs.
Hope this helps.
William
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2017 01:39 AM
Hello all,
Though its an old post but wanted to provide some more info to help others.
Problem Statement:
Populate various CMDB Classes from multiple data sources e.g. Airwatch, ADDM, JSS etc.. Most of them are having REST WS, and need a way to schedule the population of CIs through an import set while we need to keep track of CIs being populated from which DS.
Solution:
1. Get CIs from different REST WS to populate Import Set tables. We have 3 import sets for 3 different Data Sources
2. Associate the import sets with transform maps according to CI classes
3. In the onBefore transform script instead of using ServiceNow's original "CMDBTransformUtil" code snippet use below code snippet
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
// Add your code here
var cmdbUtil = new MyCMDBTransformUtil("JSS_import");
cmdbUtil.identifyAndReconcile(source, map, log);
ignore = true;
})(source, map, log, target);
4. Add a SI named MyCMDBTransformUtil which would act as a wrapper class of OoB CMDBTransformUtil,
var MyCMDBTransformUtil = Class.create();
MyCMDBTransformUtil.prototype = Object.extendsObject(CMDBTransformUtil, {
initialize: function(prm_sDISCOType) {
this.transformTable = "sys_transform_entry";
this.ds = prm_sDISCOType;
this.JSON = new JSON();
this.json = this.JSON;
this.CmdbAPI = SNC.IdentificationEngineScriptableApi;
this.dataSource = this.ds;
this.transformEntryTable = this.transformTable;
},
// Identify and Reconcile given source record and transform map
identifyAndReconcile: function(source, map, log) {
var inputPayload = this.buildInputPayload(source, map);
var outputPayload = this.CmdbAPI.createOrUpdateCI(this.dataSource, this.json.encode(inputPayload));
log.info("Identification and Reconciliation Result: " + outputPayload);
},
type: 'MyCMDBTransformUtil'
});
5. By doing this we are keeping the original class as is and at the same time allowing it to be upgraded in future versions like Istanbul or Jakarta.
6. The CI records would look like below
Note: You have to add the Sources in cmdb_ci.discovery_source field and in the transform map mapping do not map the discovery source field.
Let me know if that helps.
Thanks!
Sudipta

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2014 01:32 PM
Thanks William,
Would you be able to tell me what transform map to look in for this? I'm using OOB functionality here, and have not customized anything to that regard.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2014 04:17 PM
Wow, I just tried to search the wiki but they seem to have this wrapped up tight.
I was unable to find any reference to the out-of-box transform maps used by Discovery. I myself do not use it.
My recommendation would be to ask your sales POC or open an issue (or call) the ServiceNow Support, they are pretty fast about getting back to you.
An alternative would be to take a look into the System Import Sets ---> Transform Maps [sys_transform_map] table and try to figure it out by the name(s) or target table(s), probably cmdb_ci or one of its children.