- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2019 03:41 PM
I want to create a related list for CI form that shows all rels where current CI is the parent or child on cmdb_rel_ci, is this possible?
I've tried creating a relationship with refinequery and it works if it's simply "current.addQuery('parent', parent.sys_id);" but If I do child it just returns EVERY record on cmdb_rel_ci.
(function refineQuery(current, parent{
// Add your code here, such as current.addQuery(field, value);
current.addQuery('parent', parent.sys_id);
})(current, parent);
i've tried a few variations poking around community/dev pages without success.
var qc = current.addQuery('parent', parent.sys_id);
qc.addOrCondition('child', child.sys_id);
var qc = current.addQuery('parent', parent.sys_id).addOrCondition('child', child.sys_id);;
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2019 04:42 PM
Oops...Correction
var qc = current.addQuery('parent', parent.sys_id);
qc.addOrCondition('child',parent.sys_id);
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
07-11-2019 04:09 PM
I think you need to do below. There is no child object. You need to use current
var qc = current.addQuery('parent', parent.sys_id).addOrCondition('child', current.sys_id);;
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
07-11-2019 04:15 PM
not working, only gives me the downstream dependency CIs. same thing if I do it this way.
var qc = current.addQuery('parent', parent.sys_id);
qc.addOrCondition('child', current.sys_id);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2019 04:42 PM
Oops...Correction
var qc = current.addQuery('parent', parent.sys_id);
qc.addOrCondition('child',parent.sys_id);
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
07-12-2019 08:02 AM
Yes! Thank you, you're awesome.