Need to check if the CI has downstream relationship if yes then show a pop up
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2025 09:22 AM
If the install status Retire under the update Existing CI, Check if the Mapped Application Service has any downstream relationships if yes then it must pop-up. I have used script include and called through client script. The below code works but it checks in the table level. In table some times the record is not found but in the CI it has the relationship. Can anyone suggest me any alternative way to check if the CI has downstream relationship?
Script include:
var CheckChildExist = Class.create();
CheckChildExist.prototype = Object.extendsObject(AbstractAjaxProcessor, {
checkCI: function() {
var ciName = this.getParameter('sysparm_ciName');
var gr = new GlideRecord('cmdb_ci');
gr.addQuery('parent', ciName);
gr.query();
if (gr.next()) {
return 'true';
} else
return 'false';
},
type: 'CheckChildExist'
});
Client Script: