How to Restrict "Incident" Data to Specific 3rd Party Companies
Who is this tutorial for?
This tutorial is for users integrating multiple 3rd parties (e.g., multiple companies using Jira) with ServiceNow, and you want to ensure that each company only sees their relevant data.
Use Case
The examples here are based on the Incident type in ServiceNow. However, you can apply the same logic to other types like Change Request, Requested Item, Incident Task, etc.
If your ServiceNow instance is integrated with multiple 3rd party companies using Jira, this setup ensures that each company only sees the data associated with their Assignment Group in the Getint integration.
How does it work?

Incident 1 created in ServiceNow with Assignment Group: company1 will result in Getint creating a Bug in company1's Jira.
Incident 2 created in ServiceNow with Assignment Group: company2 will result in Getint creating a Bug in company2's Jira.
Incident 3 created in ServiceNow without an Assignment Group will not create any Bug in Jira, even if the integration is enabled.
When a Bug is created in Jira by company1 or company2:
Getint automatically creates a corresponding Incident in ServiceNow with the appropriate Assignment Group matching the company (e.g., company1 or company2).
Quick Steps
Create an Assignment Group in ServiceNow (e.g., company1).
Create a user with the username company1 and assign the roles: getint, sn_incident_read, sn_incident_write.
Add Business Rules for incidents (and other relevant types) to restrict access (Insert, Update, Read) based on the Assignment Group and username.
Add Business Rules to ensure that each company only uses its own Assignment Group.
Step 1: Create an Assignment Group in ServiceNow
To ensure that each company only has access to its own Incidents and data, first create an Assignment Group in ServiceNow.
Go to User Administration > Groups.
Create a new Assignment Group.

Name the group (e.g., company1).

Step 2: Create a ServiceNow User for Each Company
For tutorial purposes, the Assignment Group name should match the username for the integration user. Of course, it is possible to use any assignment group but, in such case, scripts defined below will have to be adjusted.
Go to User Administration > Users and create a new user (e.g., company1).
Set the User ID to company1.
Set the password for the user.
Assign the roles: getint, sn_incident_read, sn_incident_write. If the getint role doesn’t exist, create it as described earlier.







Step 3: Add a Business Rule to Restrict Access to Incidents by Assignment Group and Username
You need to create Business Rules to ensure that data visibility is restricted by Assignment Group and username.
Requirements:
The Assignment Group (e.g., company1) is created.
The user with the matching username (e.g., company1) and with the roles assigned: (getint, sn_incident_read, sn_incident_write
Steps:
Go to Administration > Business Rule.
And follow the steps shown in the pictures below:



Create a new Business Rule with the following script:
This script ensures that users only see Incidents assigned to their group, and it sets the Assignment Group automatically for new records.
Step 4: (Optional) Add Business Rule to Hide Other Assignment Groups
This step is optional and only serves to hide other Assignment Groups, ensuring that 3rd parties will only see their own Assignment Group (which matches their username) in the integration configuration.
Purpose:
This Business Rule ensures that each company only sees its own Assignment Group and hides others. This is useful for preventing 3rd parties from seeing Assignment Groups that do not belong to them.
Steps:
Go to Administration > Business Rule.
Create a new Business Rule following the steps shown in the images below.
Set the fields as shown in the image.




Script: In the Advanced tab, paste the following script to restrict the visibility of Assignment Groups based on the current user's username:
This rule ensures that only the group matching the username will be visible to each company during the integration process.

Step 5: Add Business Rule to Restrict Access to Comments from Incidents
Steps:
Go to Administration > Business Rule.
And follow steps shown on the pictures below:


Create a new Business Rule with the following script
Step 6: Add Two Business Rules to Restrict Access to Attachments from Incidents
Steps:
Go to Administration > Business Rule.
And follow steps shown on the pictures below:
In the first step you will restrict access to the sys_attachment table, and in the second step you will restrict access to the sys_attachment_doc table (which holds the data for each attachment).
Restrict access to sys_attachment table


Create a new Business Rule with the following script
Restrict access to sys_attachment_doc table
Steps:
Go to Administration > Business Rule.
And follow steps shown on the pictures below:


Create a new Business Rule with the following script
Summary
We have now restricted data access for each company to the Incidents associated with their Assignment Group. You can apply similar logic to other tables, such as Change Request, to restrict full access.
If you need any further help or if you are experiencing issues with your integration, feel free to open a support ticket at our Support Portal.
Last updated
Was this helpful?

