- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2017 01:57 AM
Hi,
I need to add 50 rows ( 50 new servers in an excel file ) into the cmdb_ci_server table(target table).while importing these servers , i need to add the relation ship between these 50 new servers with the another CI's in the cmdb_ci_service(Business services table) .
relationship should be like this:
parent CI:linux01 server
child CI :Retail Adding Points (Retail Adding points is the CI name in the business services class)
relatin type : Depends on::Used by
so , i need help for writing the transform map script for this requirement.
Thanks in advance ....
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2017 02:46 AM
Hi Robin,
Is the child ci same for all the 50 new server's ?? if so you can directly
1)create a new transform map under data source
2)target table as cmdb_ci_rel
3)change the order to 200
4)using mapping assist map the parent to ci name
5)write the following script
(function transformRow(source, target, map, log, isUpdate) {
// Add your code here
target.child="your business service";
target.type="Depends on::Used by";
})(source, target, map, log, action==="update");
Regards,
Sahitya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2017 02:46 AM
Hi Robin,
Is the child ci same for all the 50 new server's ?? if so you can directly
1)create a new transform map under data source
2)target table as cmdb_ci_rel
3)change the order to 200
4)using mapping assist map the parent to ci name
5)write the following script
(function transformRow(source, target, map, log, isUpdate) {
// Add your code here
target.child="your business service";
target.type="Depends on::Used by";
})(source, target, map, log, action==="update");
Regards,
Sahitya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2017 02:48 AM
Is the Child CI static? or does it change according to the parent CI?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2017 02:58 AM
Thanks for reply..
child CI should be different for every parent CI.
Is it possible
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2017 03:07 AM
Hi Robin,
on what basis they are related?
do you have it in the excel file that shows which server should be mapped to which business service or
do you have some conditions based on which they have to be related?