remove servers from business service
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2024 10:37 AM
Hi all,
how do I remove this server from business service.I have marked this server to non operational and install status to retire this is still showing in business service.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2024 11:11 AM
Write a before update business rule on your server table.
Change the field and table names according to your exact table.
if (current.operational_status == 'non_operational' && current.install_status == 'retire') {
// Query for related business services
var rel = new GlideRecord('cmdb_rel_ci');
rel.addQuery('child', current.sys_id); // or ‘parent’ based on your setup
rel.query();
while(rel.next()) {
// ‘type’ is the field that links to a Business Service; adjust field names as necessary
if (rel.type.getDisplayValue() == 'Uses::Used by') {
rel.deleteRecord(); // Remove the relationship
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2024 11:19 PM
Hi @ShubhiGarhwal ,
You need to go to the relationship builder and remove the relationship.
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Best regards
Anders
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2024 04:57 AM
There is no relationship with this server
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2024 05:36 AM
Hi @ShubhiGarhwal ,
If there is no relation between the business service and the server, why is the server then shown on the related list of the business service? Have you looked into the cmdb_rel_ci table?
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Best regards
Anders
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/