- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2023 01:05 PM
Here is my problem with importing relationships.
Many times, the server and the VM instance have the same name. So, when I go to import through a transform, I have no control over where this goes. I have the same issue when association a Business Capability to a Business Application or a Business Service. I cannot control which CI it chooses.
Suggestions?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2023 04:37 AM
In Transform map, you may use Source script for mapping Source field to Target field. In Source script, get the CI from specific CI class using a simple script. ex: cmdb_ci_hardware
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2023 04:37 AM
In Transform map, you may use Source script for mapping Source field to Target field. In Source script, get the CI from specific CI class using a simple script. ex: cmdb_ci_hardware
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2023 07:10 AM
For anyone looking for the scripts. For the target of Child to maps to the services table:
answer = (function transformEntry(source) {
var gr = new GlideRecord('cmdb_ci_service');
gr.addQuery('name',source.u_service);
gr.query();
if(gr.next()){
return gr.sys_id;
} })(source);
To map the Parent to the Business Capabilities Table:
answer = (function transformEntry(source) {
var gr = new GlideRecord('cmdb_ci_business_capability');
gr.addQuery('name',source.u_capability);
gr.query();
if(gr.next()){
return gr.sys_id;
} })(source);
I will probably add an onBefore script as I want to be certain not to create anything in the child or parent record