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.

Important: When creating an Incident in ServiceNow, always specify the Assignment Group field.

How does it work?

Example integration Incident ↔︎ Bug

  • 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.

Create a new Assignment Group

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

Create an Assignment Group with name 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.

Create new user

Important note:

In this tutorial, we created the getint_integration user (and it applies for most cases where you have a single ServiceNow and single Jira to integrate), but we need to create another user (for each company) and assign roles: getint, sn_incident_read, sn_incident_write)

User ID is the most important (company1)
After creating a user. Edit the user password.
Generate and then copy the password
Uncheck and click Update.
Assign Roles to the user
Assign getint, sn_incident_read, sn_incident_write. If you don't see role getint then create it as described here.

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

Important: The username and Assignment Group must be identical (case-sensitive).

Steps:

  • Go to Administration > Business Rule.

  • And follow the steps shown in the pictures below:

Create a new Business Rule
Everything should be set as in the picture above
Go to Advanced tab and paste script shown 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.

Important: Even if a 3rd party company attempts to use an Assignment Group other than their own, Getint will ignore it and still enforce the use of the username as the Assignment Group.

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.

You can also hide all groups and leave group created specifically for 3rd party (ex. “company1”)
Everything should be set as in the picture above
Go to Advanced tab and paste script shown below

  • 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.

Example for user "allegro." Only one Assignment Group is visible because username is allegro.

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:

Make sure to select sys_journal_field table
Go to Advanced tab and paste script shown 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

Make sure to select sys_attachment table
Go to Advanced tab and paste script shown below:

  • 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:

Make sure to select sys_attachment_doc table
Go to Advanced tab and paste script shown 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?