- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2023 03:39 PM
We have a catalog item that is a request to update a CI. One of the requirements for the catalog item is to display the current values of the CI and it's relationships for two specific classes of CIs (servers and applications only). Displaying the CI's current values is working, but displaying the relationships is not.
Using a specific CI that I know has a relationship with an application and a server, I created a really simple script to see if I can find why - and it's because the parent field doesn't return a value and I don't understand why.
In the above screen shot, you can see the parent CI doesn't return any value, but I know there is one, I checked the xml for the record; it exists.
Does anyone know why I can't access the parent value from cmdb_rel_ci?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2023 08:34 PM - edited 12-06-2023 08:39 PM
Hi @gjz
In your script, the line number 6 you're using comma instead of plus.
Let's try my adjustments below
gs.print('parent ci: ' + a.parent);
Or
gs.debug("parent ci: {0}", a.parent);
Cheers,
Tai Vu

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2023 03:49 PM
It should work. Can you also try a.getValue('parent')
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2023 03:58 PM - edited 12-06-2023 03:59 PM
Hi @gjz ,
Your code is perfectly fine and it should print the parent CI's sys_id the only possible caused i can think about the read access on that CI table to you or other users who are using the catalog item.
Check the read ACL on that parent class, being an admin if it's not visible to you it means some other restriction in place. Also check if this same parent is visible to you in list view from cmbd_rel_ci table.
-Thanks
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2023 08:34 PM - edited 12-06-2023 08:39 PM
Hi @gjz
In your script, the line number 6 you're using comma instead of plus.
Let's try my adjustments below
gs.print('parent ci: ' + a.parent);
Or
gs.debug("parent ci: {0}", a.parent);
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2023 08:48 PM
omg , good catch.
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution