The CreatorCon Call for Content is officially open! Get started here.

Does anybody know how to see the code for getRelatedRecords function?

ricky_raithatha
Kilo Expert

We are trying to use the solution from: http://www.servicenowguru.com/scripting/script-includes-scripting/walking-servicenowcom-cmdb-relatio... created by Mark Stanger

to be able to automatically populate the Affected CIs list based on the main CI.

However are having issues as the CIs returned are both Upstream and Downstream; and we only want Downstream.

The Script CIUTILS2 as suggested refers to a function called: getRelatedRecords which we believe would help to filter the records returned but need some help to understand it.

Any help would be most appreciated.

Thanks!

2 REPLIES 2

German Alvarez2
Tera Expert

Hi,



start lookint at this snowguru link, it will help you to find any direct referenced register from other one. --> http://www.servicenowguru.com/system-definition/find-references-specific-record/



Also, check the registers at this table, which manages the CI Relationships --> [cmdb_rel_ci]


Mamatha Thaluri
Kilo Expert

Hi Ricky,



getRelatedRecords is a method in the API 'SNC.CMDBUtil'.CMDBUtil is a JavaScript-accessible ScriptableObject.


Please find more info on the API at CMDBUtil API - ServiceNow Wiki


I didnt find any information nor script for this API available. I hope we dont have enough documentation for this API.



Regards,


Mamatha Thaluri