Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

BusinessServiceManager- Global

The BusinessServiceManager API provides methods that unify service management by converting manually-created services to application services, populating application services, and adding/removing configuration items and connections.

Use BusinessServiceManager methods in global server scripts. You must have the Application Service administrator [app_service_admin] role to call this API.

Parent Topic:Server API reference

BusinessServiceManager - BusinessServiceManager()

Instantiates a BusinessServiceManager object.

NameTypeDescription
None  
var bsManager = new SNC.BusinessServiceManager();

BusinessServiceManager - addCI(String service_id, String source_id, String target_id)

Adds a CI to a manually-created application service.

NameTypeDescription
service_idStringSys_id of the application service to add a CI to. Must be of type cmdb_ci_service_discovered.
source_idStringSys_id of the CI whose outgoing connection joins the target CI.
target_idStringSys_id of the CI to add to the service. Cannot be an excluded item. Excluded items are CIs configured in the Manual CI Inclusions/Exclusions [svc_manual_ci_exclusions_inclusions.list] table.
TypeDescription
void 
//Application service is 'PeopleSoft Portals'
//Source CI is windows server 'PS Apache01'
//Target CI is 'SAP WEB01'

var bsManager = new SNC.BusinessServiceManager();
var appService = bsManager.addCI('2fce42d80a0a0bb4004af34d7e3984c8','3a27d4370a0a0bb4006316812bf45439', '3a6cadc1c0a8ce01001f1e5d0d7d68fa');

Add a new entry point

Use the addCI() method to add a new entry point to a service by providing the following parameter values in your request:

  • Provide the service_ID as normal.
  • Leave the source_ID value empty. For example, use ''.
  • For target_ID, enter the Sys ID of the CI under which to add the new entry point.

As a result, the addCI() method creates a new entry point with a connection to the specified target CI. The following is an example of how to add a new entry point:

//Application service sys_id is '49de2b3187cd9d50d5c8a6880cbb35ea' 
//Source CI is passed as an empty string as '' 
//Target CI sys id is '15ca5fb187129910d5c8a6880cbb3537'   

var bsManager = new SNC.BusinessServiceManager(); 
var appService = bsManager.addCI('49de2b3187cd9d50d5c8a6880cbb35ea','', '15ca5fb187129910d5c8a6880cbb3537');

BusinessServiceManager - addEntryPoint(serviceId, endpointGr)

Adds an entry point to the application service and starts discovery on the entry point.

NameTypeDescription
serviceIdStingSys_id of the application service to add the connection to.
endpointGrStringGlide Record object in the CI Endpoint [cmdb_ci_endpoint] table or its child table to add to the application service.
TypeDescription
BooleanFlag indicating the entry point was successfully added to the application service. Possible values: - true: the addition was successful. - false: the addition was not successful.

The following addEntryPoint() method shows how to add a new entry point to the application service.

var now_GR = new GlideRecord("cmdb_ci_endpoint_tcp");
now_GR.initialize(); 
now_GR.setValue("host", "10.196.39.251");
now_GR.setValue("port", "8080");
now_GR.insert();
var bsManager = new SNC.BusinessServiceManager();
var serviceId = "5bf65ebeedb91300964f6fa662989533";
bsManager.addEntryPoint(serviceId,now_GR);

Output:

true

BusinessServiceManager - addEntryPointWithoutStartDiscovery(serviceId, endpointGr)

Adds a new entry point without starting discovery.

NameTypeDescription
serviceIdStringSys_id of the application service to add the connection to.
endpointGrStringGlide Record object in the CI Endpoint [cmdb_ci_endpoint] table or its child table to add to the application service.
TypeDescription
BooleanFlag indicating the entry point was successfully added to the application service. Possible values: - true: the addition was successful. - false: the addition was not successful.

The following example shows how to use the addEntryPointWithoutStartDiscovery() method to add a new entry point to the application service without initiating discovery.

var now_GR = new GlideRecord("cmdb_ci_endpoint_tcp");
now_GR.initialize(); 
now_GR.setValue("host", "10.196.39.251");
now_GR.setValue("port", "8080");
now_GR.insert();
var bsManager = new SNC.BusinessServiceManager();
var serviceId = "5bf65ebeedb91300964f6fa662989533";
bsManager.addEntryPointWithoutStartDiscovery(serviceId,now_GR);

Output:

true

BusinessServiceManager - addManualConnection(String source_id, Object manual_endpoint, String service_id)

Adds a manually created connection to an application service.

NameTypeDescription
source_idStringSys ID of the CI to add to the connection.
manual_endpointObjectGlideRecord object in the cmdb_ci_endpoint_manual table to add to the application service.
service_idStringSys ID of the application service to add the connection to.
TypeDescription
void 
var now_GR = new GlideRecord("cmdb_ci_endpoint_manual");
now_GR.initialize(); 
now_GR.name='myEndpoint'; 
now_GR.insert();

var bsManager = new SNC.BusinessServiceManager();
var appService = bsManager.addManualConnection("3a307c930a0a0bb400353965d0b8861f", now_GR, "2fce42d80a0a0bb4004af34d7e3984c8");

BusinessServiceManager - isReadingPermitted(Object gr, String userSysID)

Checks the roles of a specified user and the permissions data configured for a specified service/service group and returns a Boolean value that indicates whether the user can view the service/service group.

The following defines the process flow that the method uses to determine whether the user can view the service/service group:

  1. If the specified record is a service group, checks the user roles and group policy. For more information on assigned roles for service groups, see Assign a role to a service group.
  2. If the roles list contains “itil” but doesn’t contain “app_service_admin” and “sam_core_user”, return true.
  3. If the roles list contains “maint”, return true.
  4. If the roles list contains “app_serivce_user” but doesn’t contain “app_service_admin” and “sm_app_owner”, and the service isn’t operational, return false.
  5. Check the group of the service.
    1. If the service belongs to a single group, and the group is “all”, return true.
    2. For any non “all” group, checks the policy for user roles and group based on the rules specified in Assign a role to a service group. If any of them returns true, return true.
NameTypeDescription
grGlideRecordGlideRecord of the service/service group. This GlideRecord can be from one of the following tables:- Service Instance \[cmdb\_ci\_service\_auto\] - Application Service Group \[cmdb\_ci\_service\_group\] - Dynamic CI Group \[cmdb\_ci\_query\_based\_service\] - Manual Services \[cmdb\_ci\_service\_manual\] - Mapped Application Service \[cmdb\_ci\_service\_discovered\] - Service \[cmdb\_ci\_service\]
userSysIdStringSys\_id of the user record. Table: User \[sys\_user\]
TypeDescription
BooleanFlag that indicates whether the user has permission to view the specified service/service group.Possible values: - true: User can view the specified service/service group. - false: User can't view the specified service/service group.

The following code example shows how to call this method to check the specified user's ability to access the specified service group.

var cmdbServGr = new GlideRecord('cmdb_ci_service_discovered');
cmdbServGr.addQuery('sys_id', "123123123123123123123123");
cmdbServGr.query();
var userId = gs.getUserID();

var bsManager = new SNC.BusinessServiceManager();
while (cmdbServGr.next()) {
  var answer = bsManager.isReadingPermitted(cmdbServGr, userId);

  //do something with / according to the answer

}

BusinessServiceManager - migrateManualToApplicationService(String service_id)

Converts a manual service to an application service.

NameTypeDescription
service_idStringSys ID of the manual service to convert.
TypeDescription
BooleanTrue if the migration to an application service succeeds.
var bsManager = new SNC.BusinessServiceManager();
var appService = bsManager.migrateManualToApplicationService("451047c6c0a8016400de0ae6df9b9d76");

BusinessServiceManager - populateApplicationService(String service_id, Number levels, String black_listed_relation_types)

Populates an application service with relations and CIs from the designated entry point.

NameTypeDescription
service_idStringSys ID of the application service to populate.
levelsNumberNumber of levels of CIs to add from the CMDB.
black_listed_relation_typesStringRelation types to exclude when populating the application service.
TypeDescription
BooleanTrue if the operation is successful.
var bsManager = new SNC.BusinessServiceManager();
var appService = bsManager.populateApplicationService("5bf65ebeedb91300964f6fa662989533", 10, "Depends on::Used by");

BusinessServiceManager - removeCI(String service_id, String target_id)

Removes a manually created CI from an application service.

NameTypeDescription
service\_idString

Sys ID of the application service to remove a CI from.

Note: Passing a GlideRecord object is also supported.

target\_idString

Sys ID of the CI to remove from the application service.

Note: Passing a GlideRecord object is also supported.

TypeDescription
void 
var bsManager = new SNC.BusinessServiceManager();
var appService = bsManager.removeCI("2fce42d80a0a0bb4004af34d7e3984c8", "3a290cc60a0a0bb400000bdb386af1cf");

BusinessServiceManager - removeEntryPoint(serviceId, endpointSysId)

Removes an existing entry point from the application service.

NameTypeDescription
serviceIdStringSys_id of the application service to add the connection to.
endpointSysIdStringSys_id of the entry point endpoint to remove.
TypeDescription
BooleanFlag indicating that the entry point was successfully removed from the application service. Possible values: - true: the update was successful. - false: the update was not successful.

The following example removes the entry point associated with Sys_id “aa65ebeedb91300964f6fa6629895ss” from the given application service.

var bsManager = new SNC.BusinessServiceManager();
var serviceId = "5bf65ebeedb91300964f6fa662989533";
var entrypointId = “aa65ebeedb91300964f6fa6629895ss”;
bsManager.removeEntryPoint(serviceId, entrypointId);

Output:

true

BusinessServiceManager - removeManualConnection(String source_id, String endpoint_id, String service_id)

Removes a manually created connection and the connected CI from an application service.

NameTypeDescription
source_idStringSys ID of the CI connected to the endpoint.
endpoint_idStringSys ID of the manually created connection to remove from the application service
service_idStringSys ID of the application service to remove the connection from.
TypeDescription
void 
var bsManager = new SNC.BusinessServiceManager();
var appService = bsManager.removeManualConnection("3a307c930a0a0bb400353965d0b8861f", "60ce3176edb91300964f6fa6629895d1", "2fce42d80a0a0bb4004af34d7e3984c8");

BusinessServiceManager - updateEntryPoint(serviceId, endpointGr)

Updates an existing entry point in the application service.

NameTypeDescription
serviceIdStringSys_id of the application service to add the connection to.
endpointGrObjectGlide Record object in the CI Endpoint [cmdb_ci_endpoint] table or its child table to add to the application service.
TypeDescription
BooleanFlag indicating the update was successfully applied to the entry point. Possible values: - true: the update was successful. - false: the update was not successful.

The following updateEntryPoint() example shows how to update the connection with a new entry point.

var now_GR = new GlideRecord("cmdb_ci_endpoint_http");
now_GR.get(“11f65ebeedb91300964f6fa66298951”);
now_GR.setValue(“protocol”, “https”);
var bsManager = new SNC.BusinessServiceManager();
var serviceId = "5bf65ebeedb91300964f6fa662989533";
bsManager.updateEntryPoint(serviceId,now_GR);

Output:

true