How are Manual Endpoints from Calculated Application Services maintained

Arno Reintjens
Tera Contributor

Hi all,

We have created Calculated Application Services based on the relations. 

When CIs are retired and relations are removed we notice that some of  the manual endpoints remain. 

 

Question:

- How is the maintenance of manual endpoints arranged? 

- Does it make a difference if the the CI is of a user defined class?

 

Any information on Manual Endpoints especially how they can be removed is welcome.

Cheers,

Arno

 

1 ACCEPTED SOLUTION

AJ-TechTrek
Giga Sage
Giga Sage

Hi @Arno Reintjens ,

 

As per my understanding Issue Summary is -
* You have calculated application services built from CI relationships.
* When CIs are retired and their relationships removed, some manual endpoints still remain within the application service.


* You're seeking clarity on:
1. Maintenance of manual endpoints
2. Behavior for user-defined CI classes
3. How to remove obsolete manual endpoints

 

Explanation & Solution:

 

How is the maintenance of manual endpoints arranged?
* Manual endpoints are user-added CI associations to an Application Service that are not part of the dynamic, calculated CI set.
* They are not auto-removed even if the related CI is retired or deleted unless manually cleaned.
* These CIs exist in the cmdb_ci_service_manual table and are linked to the service via the cmdb_ci_service_auto record.


Maintenance Options:
* Manual Cleanup:
* Go to the Application Service → Related List: Manual CIs
* Remove any endpoints manually that are no longer relevant.
* Scheduled Job / Scripted Cleanup (Recommended):
* Create a script that checks:
* If the CI in cmdb_ci_service_manual is retired/inactive/deleted
* Or has no valid relationship to other service CIs
* Remove such entries automatically.


Example Script Snippet:


 

var manualCI = new GlideRecord('cmdb_ci_service_manual');
manualCI.addQuery('service', '<application_service_sys_id>');
 manualCI.query();
while (manualCI.next()) {
var ci = manualCI.ci;
if (ci.sys_class_name == 'retired' || ci.install_status == 7) {
manualCI.deleteRecord(); // Or mark for review
 }
}

 

Does it make a difference if the CI is of a user-defined class?
Yes, it can.
* Calculated services rely on CI class hierarchy and relationships defined in the CMDB model.
* If the CI belongs to a user-defined class not included in:
* Service Mapping patterns
* CMDB Class Manager's CI Relationship Rules
* or is excluded from discovery
* Then it may not be evaluated or auto-removed correctly during calculation refresh.


Recommendation:
* Ensure your custom CI class is:
* Included in the CI Class Manager under service models.
* Has correct "depends on" / "runs on" type relationships defined.
* Is not excluded in application service definition filters.

 

How can manual endpoints be removed?
You have below ways:
Manual Method:
* Go to the Application Service record → Manual CIs related list
* Click into the CI record and select "Remove from service"


Automated Cleanup:
* Build a Scheduled Scripted Cleanup that:
* Checks for install_status = Retired (value = 7)
* Validates absence of relationships or last updated time


Recreate the Service (if manual CIs are too many/outdated):
* Delete and re-calculate the service from scratch (as last resort).

 

Please appreciate the efforts of community contributors by marking appropriate response as Mark my Answer Helpful or Accept Solution this may help other community users to follow correct solution in future.
 

Thank You
AJ - TechTrek with AJ - ITOM Trainer
LinkedIn:- https://www.linkedin.com/in/ajay-kumar-66a91385/
YouTube:- https://www.youtube.com/@learnitomwithaj
Topmate:- https://topmate.io/aj_techtrekwithaj (Connect for 1-1 Session)
ServiceNow Community MVP 2025

View solution in original post

1 REPLY 1

AJ-TechTrek
Giga Sage
Giga Sage

Hi @Arno Reintjens ,

 

As per my understanding Issue Summary is -
* You have calculated application services built from CI relationships.
* When CIs are retired and their relationships removed, some manual endpoints still remain within the application service.


* You're seeking clarity on:
1. Maintenance of manual endpoints
2. Behavior for user-defined CI classes
3. How to remove obsolete manual endpoints

 

Explanation & Solution:

 

How is the maintenance of manual endpoints arranged?
* Manual endpoints are user-added CI associations to an Application Service that are not part of the dynamic, calculated CI set.
* They are not auto-removed even if the related CI is retired or deleted unless manually cleaned.
* These CIs exist in the cmdb_ci_service_manual table and are linked to the service via the cmdb_ci_service_auto record.


Maintenance Options:
* Manual Cleanup:
* Go to the Application Service → Related List: Manual CIs
* Remove any endpoints manually that are no longer relevant.
* Scheduled Job / Scripted Cleanup (Recommended):
* Create a script that checks:
* If the CI in cmdb_ci_service_manual is retired/inactive/deleted
* Or has no valid relationship to other service CIs
* Remove such entries automatically.


Example Script Snippet:


 

var manualCI = new GlideRecord('cmdb_ci_service_manual');
manualCI.addQuery('service', '<application_service_sys_id>');
 manualCI.query();
while (manualCI.next()) {
var ci = manualCI.ci;
if (ci.sys_class_name == 'retired' || ci.install_status == 7) {
manualCI.deleteRecord(); // Or mark for review
 }
}

 

Does it make a difference if the CI is of a user-defined class?
Yes, it can.
* Calculated services rely on CI class hierarchy and relationships defined in the CMDB model.
* If the CI belongs to a user-defined class not included in:
* Service Mapping patterns
* CMDB Class Manager's CI Relationship Rules
* or is excluded from discovery
* Then it may not be evaluated or auto-removed correctly during calculation refresh.


Recommendation:
* Ensure your custom CI class is:
* Included in the CI Class Manager under service models.
* Has correct "depends on" / "runs on" type relationships defined.
* Is not excluded in application service definition filters.

 

How can manual endpoints be removed?
You have below ways:
Manual Method:
* Go to the Application Service record → Manual CIs related list
* Click into the CI record and select "Remove from service"


Automated Cleanup:
* Build a Scheduled Scripted Cleanup that:
* Checks for install_status = Retired (value = 7)
* Validates absence of relationships or last updated time


Recreate the Service (if manual CIs are too many/outdated):
* Delete and re-calculate the service from scratch (as last resort).

 

Please appreciate the efforts of community contributors by marking appropriate response as Mark my Answer Helpful or Accept Solution this may help other community users to follow correct solution in future.
 

Thank You
AJ - TechTrek with AJ - ITOM Trainer
LinkedIn:- https://www.linkedin.com/in/ajay-kumar-66a91385/
YouTube:- https://www.youtube.com/@learnitomwithaj
Topmate:- https://topmate.io/aj_techtrekwithaj (Connect for 1-1 Session)
ServiceNow Community MVP 2025