BusinessServiceManager - Global
-
- UpdatedJan 30, 2025
- 6 minutes to read
- Yokohama
- API reference
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.
BusinessServiceManager - BusinessServiceManager()
Instantiates a BusinessServiceManager object.
Name | Type | Description |
---|---|---|
None |
Example
BusinessServiceManager - addCI(String service_id, String source_id, String target_id)
Adds a CI to a manually-created application service.
Name | Type | Description |
---|---|---|
service_id | String | Sys_id of the application service to add a CI to. Must be of type cmdb_ci_service_discovered. |
source_id | String | Sys_id of the CI whose outgoing connection joins the target CI. |
target_id | String | Sys_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. |
Type | Description |
---|---|
void |
Example
Add a new entry point
- 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.
BusinessServiceManager - addEntryPoint(serviceId, endpointGr)
Adds an entry point to the application service and starts discovery on the entry point.
Name | Type | Description |
---|---|---|
serviceId | Sting | Sys_id of the application service to add the connection to. |
endpointGr | String | Glide Record object in the CI Endpoint [cmdb_ci_endpoint] table or its child table to add to the application service. |
Type | Description |
---|---|
Boolean | Flag indicating the entry point was successfully added to the application service. Possible values:
|
Example
The following addEntryPoint() method shows how to add a new entry point to the application service.
Output:
BusinessServiceManager - addEntryPointWithoutStartDiscovery(serviceId, endpointGr)
Adds a new entry point without starting discovery.
Name | Type | Description |
---|---|---|
serviceId | String | Sys_id of the application service to add the connection to. |
endpointGr | String | Glide Record object in the CI Endpoint [cmdb_ci_endpoint] table or its child table to add to the application service. |
Type | Description |
---|---|
Boolean | Flag indicating the entry point was successfully added to the application service. Possible values:
|
Example
The following example shows how to use the addEntryPointWithoutStartDiscovery() method to add a new entry point to the application service without initiating discovery.
Output:
BusinessServiceManager - addManualConnection(String source_id, Object manual_endpoint, String service_id)
Adds a manually created connection to an application service.
Name | Type | Description |
---|---|---|
source_id | String | Sys ID of the CI to add to the connection. |
manual_endpoint | Object | GlideRecord object in the cmdb_ci_endpoint_manual table to add to the application service. |
service_id | String | Sys ID of the application service to add the connection to. |
Type | Description |
---|---|
void |
Example
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:
- 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.
- If the roles list contains “itil” but doesn’t contain “app_service_admin” and “sam_core_user”, return true.
- If the roles list contains “maint”, return true.
- 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.
- Check the group of the service.
- If the service belongs to a single group, and the group is “all”, return true.
- 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.
Name | Type | Description |
---|---|---|
gr | GlideRecord | GlideRecord of the service/service group. This GlideRecord can be from one of the following tables:
|
userSysId | String | Sys_id of the user record. Table: User [sys_user] |
Type | Description |
---|---|
Boolean | Flag that indicates whether the user has permission to view the specified service/service group. Possible values:
|
Example
The following code example shows how to call this method to check the specified user's ability to access the specified service group.
BusinessServiceManager - migrateManualToApplicationService(String service_id)
Converts a manual service to an application service.
Name | Type | Description |
---|---|---|
service_id | String | Sys ID of the manual service to convert. |
Type | Description |
---|---|
Boolean | True if the migration to an application service succeeds. |
Example
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.
Name | Type | Description |
---|---|---|
service_id | String | Sys ID of the application service to populate. |
levels | Number | Number of levels of CIs to add from the CMDB. |
black_listed_relation_types | String | Relation types to exclude when populating the application service. |
Type | Description |
---|---|
Boolean | True if the operation is successful. |
Example
BusinessServiceManager - removeCI(String service_id, String target_id)
Removes a manually created CI from an application service.
Name | Type | Description |
---|---|---|
service_id | String | Sys ID of the application service to remove a CI from. Note: Passing a GlideRecord object is also supported. |
target_id | String | Sys ID of the CI to remove from the application service. Note: Passing a GlideRecord object is also supported. |
Type | Description |
---|---|
void |
Example
BusinessServiceManager - removeEntryPoint(serviceId, endpointSysId)
Removes an existing entry point from the application service.
Name | Type | Description |
---|---|---|
serviceId | String | Sys_id of the application service to add the connection to. |
endpointSysId | String | Sys_id of the entry point endpoint to remove. |
Type | Description |
---|---|
Boolean | Flag indicating that the entry point was successfully removed from the application service. Possible values:
|
Example
The following example removes the entry point associated with Sys_id “aa65ebeedb91300964f6fa6629895ss” from the given application service.
Output:
BusinessServiceManager - removeManualConnection(String source_id, String endpoint_id, String service_id)
Removes a manually created connection and the connected CI from an application service.
Name | Type | Description |
---|---|---|
source_id | String | Sys ID of the CI connected to the endpoint. |
endpoint_id | String | Sys ID of the manually created connection to remove from the application service |
service_id | String | Sys ID of the application service to remove the connection from. |
Type | Description |
---|---|
void |
Example
BusinessServiceManager - updateEntryPoint(serviceId, endpointGr)
Updates an existing entry point in the application service.
Name | Type | Description |
---|---|---|
serviceId | String | Sys_id of the application service to add the connection to. |
endpointGr | Object | Glide Record object in the CI Endpoint [cmdb_ci_endpoint] table or its child table to add to the application service. |
Type | Description |
---|---|
Boolean | Flag indicating the update was successfully applied to the entry point. Possible values:
|
Example
The following updateEntryPoint() example shows how to update the connection with a new entry point.
Output:
On this page
- BusinessServiceManager - BusinessServiceManager()
- BusinessServiceManager - addCI(String service_id, String source_id, String target_id)
- BusinessServiceManager - addEntryPoint(serviceId, endpointGr)
- BusinessServiceManager - addEntryPointWithoutStartDiscovery(serviceId, endpointGr)
- BusinessServiceManager - addManualConnection(String source_id, Object manual_endpoint,
String service_id)
- BusinessServiceManager - isReadingPermitted(Object gr, String userSysID)
- BusinessServiceManager - migrateManualToApplicationService(String service_id)
- BusinessServiceManager - populateApplicationService(String service_id, Number levels,
String black_listed_relation_types)
- BusinessServiceManager - removeCI(String service_id, String target_id)
- BusinessServiceManager - removeEntryPoint(serviceId, endpointSysId)
- BusinessServiceManager - removeManualConnection(String source_id, String endpoint_id,
String service_id)
- BusinessServiceManager - updateEntryPoint(serviceId, endpointGr)