ServiceNow Connector Prerequisites
Connector Requirements
Features | Supported | Additional Information |
---|---|---|
ServiceNow version | Yes |
|
Searchable content types | Yes | All content types. |
Content Update | Full and Incremental |
|
Attachment support | Knowledge articles, Announcements |
|
Permission Types |
|
|
Required Software |
|
|
User Accounts and Application Permissions
Required Permission | Description |
---|---|
ServiceNow User Accounts |
The ServiceNow connector requires the following:
Note: The time zone for the user account must be set to UTC.
See Setting the User Account's Time Zone topic below. |
Security |
The user account specified above must have access to the following resources:
|
Scripted REST API |
|
Permissions for knowledge templates
If you are using Knowledge Template tables, will also require read permissions. These tables may or may not exist in your installation, therefore any templates that are deployed and enabled cannot be listed in the permissions table above. To determine which tables are being used and require permissions, run the following query: /api/now/table/kb_article_template?sysparm_fields=child_table. Any child_table should be granted read access.
ServiceNow Setup for the Connector
Account Permissions
To complete the setup process, you:
- Create an account for the BA Insight ServiceNow Connector
- Apply user permissions for the account in ServiceNow
Use the following instructions to complete the account and permission setup process.
- In ServiceNow, tables the account can read can be selected, and permissions given to the Connector to read the entries in the roles table (without being Admins): this is a requirement for reading the security.
- However, in ServiceNow the rules go to the record level.
- "AFAIK," by default, has an ADMIN role with a special rule declaring it must not appear – this must be overridden and declared, so the Connector account can read it.
See the following code:
- "AFAIK," by default, has an ADMIN role with a special rule declaring it must not appear – this must be overridden and declared, so the Connector account can read it.
By default, the condition declares:
- ADMIN role: Seen only by users who are members of the ADMIN role.
- SECURITY_ADMIN role: Seen only by users who are members of the SECURITY_ADMIN role.
- MAINT role and NOBODY role: Seen only by users who are members of the MAINT role.
- All other roles are seen by users as they are configured in the rules.
The condition must be changed. To change it, use the following instructions:
- Rule is defined by default in the tenancy – in the System Security > Access Control List page:
- Next, Elevate roles to SecurityAdmin privileges so that you can edit the record.
- Edit the script of the record and ensure the user name is same one the connector uses and is returned as "
true
". - Alternatively:
- Option 1: Remove the script all together
Option 2: Add another line at the top of the script:
More available functions here: https://www.servicenowguru.com/scripting/user-object-cheat-sheet/
Copyif(gs.getUserID() == “The connector user sys_id”)
answer = true
else ….<the original snippet> ….
Resolving Scripted User Criteria
For the connector to properly secure content, User Criteria must be resolved upon Security Sync Loads User and Group tables and executes the mapping based on the connector configuration. execution.
To resolve User Criteria a Scripted Rest API must be added to the ServiceNow environment.
-
Navigate to the Scripted Rest APIs interface.
-
Create a new Scripted Rest API.
-
Add a new Resource and Save.
Copy(function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {
var userIds = request.body.data["userIds"];
var ucIds = request.body.data["ucIds"];
var bodyArray = [];
for (var i = 0; i < userIds.length; i++)
{
var body = {};
body.userId = userIds[i];
var allCriterias = sn_uc.UserCriteriaLoader.getMatchingCriteria(userIds[i], ucIds);
body.ucIds = allCriterias;
bodyArray.push(body);
}
response.SetContentType('application/json');
response.setStatus(200);
response.setBody(bodyArray);
})(request, response); -
Use the Explore Rest API link on the bottom of the page.
-
Copy the POST URL to use in configuring the Connector.
Setting the User Account's Time Zone
For the connector to properly enumerate content, the user account must be assigned the UTC time zone.
To assign the UTC time zone to the user:
- Go to the sys_user table.
- Edit the service account user profile.
- If the Time Zone field does not appear in the view, edit the view and add the field.
- Set the Time Zone field to "UTC" and save the changes.