Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
If your ServiceNow instance uses Advanced scripts in your Catalog Items or Catalog Category user criteria, you need to use the Advanced flow. It ensures accurate permissions handling when ingesting content into Microsoft Graph.
Step 1: Select advanced flow in setup
When setting up the ServiceNow Catalog Copilot connector, select the Advanced option under the field 'Select based on your user criteria setup in ServiceNow'. This is crucial for handling advanced user criteria correctly.
Step 2: Configure Scripted REST API in ServiceNow
To allow the connector to fetch advanced user criteria, you must create a Scripted REST API in your ServiceNow instance. Follow the following steps:
2.1: Elevate User Role
- Elevate your role in ServiceNow to
security_admin
.
2.2: Create Access Control (ACL)
- In ServiceNow, navigate to All > System Security > Access Control (ACL).
- Click New to create a new ACL.
- Set the following values:
- Type:
REST_Endpoint
- Operation:
Execute
- Name:
Microsoft Copilot
- Role:
admin
(or the same role assigned to the crawling account)
- Type:
- Click Submit.
2.3: Create Scripted REST API
Navigate to All > System Web Services > Scripted Web Services > Scripted REST APIs.
Click New.
Enter the following:
- Name:
Microsoft Copilot
- API ID:
microsoft_copilot
- Name:
Click Submit.
From the Scripted REST API list page, click on
Microsoft Copilot
- the REST API you just created.Set Default ACLs to
Microsoft Copilot
(from step 2.2).
2.4: Add a Resource to the API
In the Resources tab, click New.
Fill in the details:
Name:
GetAllUserCriteria
Active:
True
HTTP method:
GET
Relative Path:
/user_criteria
Script: Paste the following code:
(function execute (/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) { var queryParams = request.queryParams; var user = new String(queryParams.user); return (new sn_uc.UserCriteriaLoader()).getAllUserCriteria(user); })(request, response);
Make sure both of the following are checked under Security:
- Requires authentication
- Requires ACL authorization
Ensure ACLs is set to
Microsoft Copilot
.Select Update.
2.5: Verify Setup
Confirm that the Resource Path is
/api/<API Namespace>/microsoft_copilot/user_criteria
.Select Update to save the configuration.
Step 3: Enter the API Namespace in the Copilot Connector Setup Experience
In the Copilot connector setup, enter the API Namespace you created in ServiceNow.
Note
You can find the API namespace in the Resource Path field shown in Step 2.5. You only need the namespace portion - not the full path.
For example: If the Resource Path is /api/abcdef/microsoft_copilot/user_criteria
, then the API namespace is abcdef
.