ServiceNow Integration Hub
If you are using ServiceNow's Integration Hub and Automation Engine for integrations, you can also utilize our ONEiO Spoke for integrating with ONEiO. You can read the full instructions on our ServiceNow Store page.
Overview
This article explains the steps to set up a bi-directional integration between ServiceNow and ONEiO. The process involves two main tasks:
- 1. Configuring Message Flow from ServiceNow to ONEiO
- 2. Configuring Message Flow from ONEiO to ServiceNow
If you have any questions about setting up the integration, feel free to email support@oneio.cloud.
You can sign up for a free ONEiO trial using the link below.
1. Configuring Message Flow from ServiceNow to ONEiO
ServiceNow communicates with ONEiO via a REST message as part of the ServiceNow REST API. This REST message is pre-configured in the Update Set provided by ONEiO.
1.1 Retrieve the Update Set
For your convenience, ONEiO provides a pre-configured Update Set that includes everything needed for ServiceNow to communicate with ONEiO. While not mandatory, it simplifies the configuration process. You can download it from the ServiceNow Developer site using the button below.
The update set contains:
- The REST message,
- a Business Rule for the incident table, and
- 2 Business Rules for sending out attachments.
1.2 Import the Update Set to ServiceNow
Begin the import process by uploading the Update Set at:
System Update Sets Retrieved Update Sets Import Update Set from XML
Upload the update set retrieved previously.
1.3 Commit the Update Set in ServiceNow
Open ONEiO Integration Components
Following Business Rules are included in the Update Set:
- ONEiO Incident Integration Post: Used to send incident data from the Incident table.
- ONEiO Attachment After Correlation ID: Handles attachment transfer when an incident is initially created.
- ONEiO Send Attachment: Used to send attachments as part of an update to an existing incident.
Select Preview Update Set, close the dialog, then select Commit Update Set and close the dialog:
1.4 Configure the REST Message in ServiceNow
To enable communication from ServiceNow to ONEiO, a REST message is used with ONEiO-specific settings for the target URL, HTTP method, and content type. Authentication must be configured individually for each endpoint.
You can find the REST message settings under:
System Web Services Outbound REST Message ONEiO
The Endpoint field in the REST message contains the ONEiO receiver URL. The available endpoints are:
- QA: https://rest-receiver-test.service-flow.com/api
- Production: https://rest-receiver.service-flow.com/api
By default, the QA URL is pre-configured. Update it to the production URL if required:
1.5 Create an Endpoint for ServiceNow in ONEiO
For each integration endpoint - such as a ServiceNow instance - you need to create an endpoint once in ONEiO. After that, it can be reused in other integrations.
To create the endpoint, log in to ONEiO, select the appropriate environment, and navigate to:
Endpoints New Endpoint
- Name: the name for the endpoint (free text)
- ServiceNow root URL: insert the root URL of your ServiceNow (without a path or a trailing slash)
- Timezone: select the timezone you are in or that you use in ServiceNow
- How to start a ONEiO Free Trial.
- Read more about ONEiO's User Interface and the Endpoints view.
- For more details on ServiceNow endpoints in ONEiO, see ONEiO's Endpoint Type Configuration Guide for ServiceNow.
1.6 Configure ONEiO Authentication in ServiceNow
In ONEiO you have two options to configure authentication for messages received from ServiceNow:
1.6 Basic Authentication
The ONEiO Username and Password required for configuration are available in your ServiceNow endpoint settings in ONEiO. The Username is always visible, but you’ll need to switch to Edit mode to access the Generate new password button. Copy the password to the clipboard and close the dialog.
Important
After generating the new password, make sure to save the ServiceNow endpoint in ONEiO for the changes to take effect.
Return to your ServiceNow instance and configure the Basic Auth Profile within the REST Message.
To do this, click the info icon next to the Basic Auth profile field, then select Open Record. Insert the ONEiO Username and the Password and click Update in the dialog.
1.7 OAuth 2.0 Authentication (skip if you are using Basic Authentication)
You can also authenticate using OAuth 2.0 as an alternative to Basic Authentication. For detailed instructions on how to set up OAuth 2.0, please refer to this article.
1.8 Verify the Integration and Send a test message in ServiceNow to ONEiO
With authentication now configured, it’s time to verify that the connection is working as expected.
To support this, the Update Set includes a REST message specifically for testing purposes. This test message uses a hardcoded payload and is not dynamically populated with actual ticket data.
To run the test, open "Test Authentication to ONEiO" and click the Test link on the left side of the screen.
This sends a test payload to ONEiO and, if successful, returns an HTTP 202 status along with a Response ID:
This message will also be visible in the ONEiO Message View:
1.9 If needed: Handling Encrypted Attachments
- Create a dedicated role with access to the encryption module and assign it to the integration user, or
- Grant encryption module access to an existing role, such as ITIL.
1.10 Verify the Integration by Creating a Test Incident in ServiceNow
Now that the ServiceNow integration is set up we can create our first incident.
Incident Create new
Fill in the required fields such as Caller and Short Description and any other information required for your test scenario. Click to Submit the Incident.
Note: receiving attachments in ONEiO only works after the ServiceNow credentials are configured in ONEiO (see details here), and after ONEiO sets the correlation ID (which requires the initial rules to be configured).
The Incident should show up in the ONEiO Message View.
Congratulations, you have successfully integrated your ServiceNow with ONEiO.
1.11 If Needed: Adjust Business Rules
Business Rule: ONEiO Incident Integration Post
Navigate to:
System Definition Business Rules ONEiO Incident Integration Post
Select the Advanced tab:
Here, you can edit the condition that determines when messages are sent to ONEiO. By default, messages are not sent if they were updated by the ONEiO integration user "oneio", to prevent “echoes” back to ONEiO when messages are received from it.
Additionally, you can specify fields to exclude from the payload sent to ONEiO. To do this, add a comma-separated list of field names to the exclusion array within the post call in the script. For example:
new ONEiOLibrary().post(current, 'ONEiO', 'post', ['assigned_to', 'sys_created_by']);
Once you’ve made your changes, click Update to save them.
Business Rules for Attachment Handling:
“ONEiO Attachment after Correlation ID” and “ONEiO Send Attachment” handle attachments during Create and Update operations, with default conditions provided for convenience.
1.12 If Needed: Duplicate Business Rules for Additional Processes
The steps above apply to the default Incident integration. To integrate additional processes in ServiceNow, simply clone or extend the existing Business Rules as needed.
To do this navigate to:
System Definition Business Rules ONEiO Incident Integration Post
Then:
- Right-click the top gray menu bar.
- Select Insert and Stay to create a clone of the current rule.
Return to the Business Rules list view. You can now see two ONEiO Incident integration Post rules:
Edit the newly created Business Rule and update the Name and Table fields to align with your specific process.
In the example below, we are configuring it for the Problem process:
This approach also allows you to send tickets from ServiceNow’s Problem table to ONEiO.
If your Problem process includes sending attachments, also clone the ONEiO Attachment After Correlation ID Business Rule and change the Table from Incident to the one relevant to your process (e.g. Problem).
There’s no need to clone the ONEiO send attachment Business Rule, as it operates on the sys_attachment table and applies globally.
2. Configuring Message Flow from ONEiO to ServiceNow
ONEiO accesses ServiceNow through its REST API.
2.1 Create an Integration user in ServiceNow
An integration user is used to allow for creating and updating records via ServiceNow’s Table API.
Make sure the credentials match those configured in the ServiceNow adapter settings in ONEiO.
In ServiceNow, navigate to:
Organization Users New
Define the details for the integration user:
- User ID: “oneio”. This username is pre-configured in the Business Rules. You may use a different name, but be sure to update all relevant references in the Business Rules.
- Access: Enable "web service access only".
- Save the user: Right-click on the gray header area (User - New record) and select "Save".
2.2 Provide Permissions for the Integration User
At the bottom of the User record, select the Roles tab and click on Edit:
Search for the Collection itil, add it to the Roles List and click Save:
Click Set Password, then select Generate and copy the password to your clipboard. Save it in a secure location for future use.
Next, click Save Password and close the dialog.
Finally, click Update in the top-right corner to complete the user creation.
2.3 Configure ServiceNow Authentication in ONEiO
After completing the steps above, you can proceed to configure ServiceNow authentication in ONEiO. There are two options for setting up authentication for messages received by ServiceNow:
2.3.1 Basic Authentication
Under ONEiO -> ServiceNow on the right, select "Basic" as method and enter the integration user's credentials into the ServiceNow User and Password fields. Then save your endpoint.
2.3.2 OAuth 2.0 Authentication (skip if you are using Basic Authentication)
Configure the ServiceNow integration user, password, Client ID, and Client Secret.
How to get Client ID and Client Secret in ServiceNow
In ServiceNow, select:
System OAuth Applicaiton Registry New
Select option Create an OAuth API endpoint for external clients
Here you can create your OAuth 2.0 credentials
The Client ID is generated automatically. For the Client Secret, you can either enter your own value or leave it blank - if left blank, it will be generated automatically when the OAuth 2.0 record is saved.
Next, return to ONEiO, enter the Client ID and Client Secret into the corresponding fields, and save your endpoint.
2.4 Attachment handling
ONEiO sends attachments to ServiceNow using ServiceNow's Attachment API. To enable this, the outbound message must include the attribute sys_id, containing the sys_id of the target record in ServiceNow.
2.5 Verification of the Integration
To verify an integration from ONEiO to ServiceNow, a second endpoint must be configured.
For example, to set up a bi-directional integration between ServiceNow and Jira using ONEiO, you’ll also need to integrate Jira and create a corresponding endpoint in ONEiO. In addition, you’ll define Routing Rules to correctly map fields between ServiceNow and Jira.
For details on integrating Jira with ONEiO, refer to this article. A video tutorial is also available that walks through the complete ServiceNow–Jira integration.
We have many more tutorials available on our support site.
Comments
Please sign in to leave a comment.