ServiceNow
Port's ServiceNow integration allows you to model ServiceNow resources in your software catalog and ingest data into them.
Core support
The ServiceNow integration uses the ServiceNow Table API to ingest entities, which means you can ingest any resource that exists in the Table API, not just the ones listed above. Simply specify the table name as a new kind in the Connectors configuration page and the records from the table will be ingested to Port.
Setup
Authentication methods
The ServiceNow integration supports two authentication methods:
- Basic authentication - Uses a ServiceNow username and password.
- OAuth 2.0 client credentials - Uses OAuth client ID and client secret for more secure authentication.
OAuth 2.0 is the recommended authentication method as it provides better security and doesn't require sharing user credentials. The integration automatically handles token refresh and expiration.
You can configure the authentication method by providing the appropriate credentials:
- For basic authentication, provide
servicenowUsernameandservicenowPassword. - For OAuth authentication, provide
servicenowClientIdandservicenowClientSecret.
The integration will automatically detect and use OAuth authentication if client credentials are provided.
Setting up OAuth in ServiceNow (click to expand)
To use OAuth authentication, you need to create an OAuth application endpoint in ServiceNow:
- Log in to your ServiceNow instance as an administrator.
- Navigate to System OAuth > Application Registry.
- Click New to create a new application.
- Select Create an OAuth API endpoint for external clients.
- Fill in the following details:
- Name: Give your application a descriptive name (e.g., "Port Integration").
- Client ID: This will be auto-generated, or you can specify a custom one.
- Client Secret: This will be auto-generated. Make sure to copy it securely.
- Accessible from: Select "All application scopes".
- Click Submit to save the configuration.
- Use the generated Client ID and Client Secret in your integration configuration.
For detailed information about OAuth client credentials configuration in ServiceNow, refer to the ServiceNow OAuth documentation.
Installation methods
Choose your preferred installation method below. Not sure which to pick? See the installation methods overview.
The prerequisites required for installation are listed below.
-
Go to the Servicenow Connectors page in Port.
-
Under
Select your installation method, chooseHosted by Port. -
Configure the
Installation parametersandAdvanced configurationas you wish (see below for details).
Installation parameters
Each integration requires specific parameters (such as an API token, a URL, etc.), as seen in Port's UI when installing it. Hover over the ⓘ icon next to each parameter to see more details about it.
Advanced configuration
- During the installation process each integration may have additional settings under the
Advanced configurationsection in Port's UI. Additionally, each integration has one or more settings that can be configured after installation. To do so, click on the integration's name in the Connectors page and navigate to theSettingtab. Hover over the ⓘ icon next to each setting to see more details about it.
Port secrets
Some integration settings require sensitive pieces of data, such as tokens. For these settings, Port secrets will be used, ensuring that your sensitive data is encrypted and secure.
When filling in such a setting, its value will be obscured (shown as ••••••••).
For each such setting, Port will automatically create a secret in your organization.
To see all secrets in your organization, follow these steps.
Port source IP addresses
When using this installation method, Port will make outbound calls to your 3rd-party applications from static IP addresses. You may need to add these addresses to your allowlist, in order to allow Port to interact with the integrated service:
- Europe (EU):
54.73.167.226,63.33.143.237,54.76.185.219 - United States (US):
3.234.37.33,54.225.172.136,3.225.234.99
-
Go to the Servicenow Connectors page in your portal.
-
Select the
Self-hostedmethod. -
A
helmcommand will be displayed, with default values already filled out (e.g. your Port client ID, client secret, etc). Copy the command, replace the placeholders with your values, then run it in your terminal to install the integration.
Required parameters:
port.clientId- Your Port client ID (How to get the credentials).port.clientSecret- Your Port client secret (How to get the credentials).port.baseUrl- Your Port API URL -https://api.port.iofor EU,https://api.us.port.iofor US.integration.identifier- Change the identifier to describe your integration.integration.type- The integration to be installed.integration.eventListener.type- The event listener type. Read more about event listeners.integration.config.servicenowUrl- The ServiceNow instance URL. For example https://example-id.service-now.com.integration.config.servicenowClientId- The ServiceNow OAuth client ID. Required when using OAuth authentication.integration.secrets.servicenowClientSecret- The ServiceNow OAuth client secret. Required when using OAuth authentication.integration.config.servicenowUsername- The ServiceNow account username. Required when using basic authentication.integration.secrets.servicenowPassword- The ServiceNow account password. Required when using basic authentication.
Optional parameters (click to expand)
integration.config.enableTablesLiveEventsWebhooks- Enable automatic creation of Business Rules in ServiceNow for real-time events forwarding to Port. When enabled, Business Rules are created for every supported table in your mapping configuration, or only for tables specified inliveEventTables.integration.config.liveEventTables- Optional list of supported table names to configure for live events. If not specified butenableTablesLiveEventsWebhooksis true, all supported tables from your mapping configuration will be configured. Tables not in the supported list will be skipped.integration.secrets.webhookSecret- A secret token used to authenticate incoming webhook requests from ServiceNow. When configured, the integration automatically provisions anAuthorizationheader on the ServiceNow REST Message and validates it on incoming requests. Only relevant whenenableTablesLiveEventsWebhooksis enabled.scheduledResyncInterval- The number of minutes between each resync. When not set the integration will resync for each event listener resync event. Read more about scheduledResyncInterval.initializePortResources- Default true, When set to true the integration will create default blueprints and the port App config Mapping.sendRawDataExamples- Enable sending raw data examples from the third party API to port for testing and managing the integration mapping. Default is true.
Enabling webhooks for tables is a heavy operation that creates business rules for all/specified tables by liveEventTables. Use this to limit which tables trigger live events.
If you're running high volumes of live events in a self-hosted deployment and want better reliability, event durability, or horizontal scalability, you can optionally set up Port's dedicated live events infrastructure. See live events at scale for details.
Recommended resource sizes
To ensure optimal performance and avoid out-of-memory (OOM) errors, we recommend the following resources for this integration:
- CPU Limit:
800m - CPU Request:
100m - Memory Limit:
1Gi - Memory Request:
1Gi
Set resource values
helm install my-integration port-labs/port-ocean \
# ... other parameters
--set resources.limits.cpu=800m \
--set resources.limits.memory=1Gi \
--set resources.requests.cpu=100m \
--set resources.requests.memory=1Gi
- GitHub
- Jenkins
- Azure DevOps
- GitLab
- Go to the Servicenow Connectors page in your portal.
- Under Select your installation method, choose your desired CI/CD platform.
- Copy the workflow and replace the placeholders with your values.
Below are the available parameters and their descriptions.
| Parameter | Description | Required? | Secret?Store this value as a GitHub Actions secret |
|---|---|---|---|
port_client_id | Your Port client ID (How to get the credentials). | ✓ | ✓ |
port_client_secret | Your Port client secret (How to get the credentials). | ✓ | ✓ |
port_base_url | Your Port API URL (https://api.port.io for EU, https://api.us.port.io for US). | ✓ | ✗ |
servicenow_url | The ServiceNow instance URL. For example https://example-id.service-now.com. | ✓ | ✓ |
servicenow_client_id | The ServiceNow OAuth client ID. Required when using OAuth authentication. | ✓ | ✓ |
servicenow_client_secret | The ServiceNow OAuth client secret. Required when using OAuth authentication. | ✓ | ✓ |
servicenow_username | The ServiceNow account username. Required when using basic authentication. | ✓ | ✓ |
servicenow_password | The ServiceNow account password. Required when using basic authentication. | ✓ | ✓ |
initialize_port_resources | Default true. When set to true, the integration will create default blueprints and the Port app config mapping. | ✗ | ✗ |
integration_identifier | The identifier of the integration that will be installed. | ✗ | ✗ |
send_raw_data_examples | Enable sending raw data examples from the third-party API to Port for testing and managing the integration mapping. Default is true. | ✗ | ✗ |
Your Jenkins agent must be able to run Docker commands.
Below are the available parameters and their descriptions.
| Parameter | Description | Required? | Secret?Store this value as a Jenkins credential (Secret Text) |
|---|---|---|---|
OCEAN__ | Your Port client ID (How to get the credentials). | ✓ | ✓ |
OCEAN__ | Your Port client secret (How to get the credentials). | ✓ | ✓ |
OCEAN__ | Your Port API URL (https://api.port.io for EU, https://api.us.port.io for US). | ✓ | ✗ |
OCEAN__ | The ServiceNow instance URL. For example https://example-id.service-now.com. | ✓ | ✓ |
OCEAN__ | The ServiceNow OAuth client ID. Required when using OAuth authentication. | ✓ | ✓ |
OCEAN__ | The ServiceNow OAuth client secret. Required when using OAuth authentication. | ✓ | ✓ |
OCEAN__ | The ServiceNow account username. Required when using basic authentication. | ✓ | ✓ |
OCEAN__ | The ServiceNow account password. Required when using basic authentication. | ✓ | ✓ |
OCEAN__ | Default true. When set to true, the integration will create default blueprints and the Port app config mapping. | ✗ | ✗ |
OCEAN__ | The identifier of the integration that will be installed. | ✗ | ✗ |
OCEAN__ | Enable sending raw data examples from the third-party API to Port for testing and managing the integration mapping. Default is true. | ✗ | ✗ |
Here is an example for a Jenkinsfile pipeline file:Jenkins pipeline (click to expand)
Prerequisites
- Your Azure Devops agent should be able to run docker commands. Learn more about agents here.
- You must have permissions to create and manage Azure DevOps variable groups for storing credentials.
Set up your credentials
- Create a Variable Group: Name it port-ocean-credentials.
- Store the required variables (see the table below).
- Authorize Your Pipeline:
-
Go to "Library" -> "Variable groups."
-
Find port-ocean-credentials and click on it.
-
Select "Pipeline Permissions" and add your pipeline to the authorized list.
-
Below are the available parameters and their descriptions.
| Parameter | Description | Required? | Secret?Store this value as an Azure DevOps pipeline variable |
|---|---|---|---|
OCEAN__ | Your Port client ID (How to get the credentials). | ✓ | ✓ |
OCEAN__ | Your Port client secret (How to get the credentials). | ✓ | ✓ |
OCEAN__ | Your Port API URL (https://api.port.io for EU, https://api.us.port.io for US). | ✓ | ✗ |
OCEAN__ | The ServiceNow instance URL. For example https://example-id.service-now.com. | ✓ | ✓ |
OCEAN__ | The ServiceNow OAuth client ID. Required when using OAuth authentication. | ✓ | ✓ |
OCEAN__ | The ServiceNow OAuth client secret. Required when using OAuth authentication. | ✓ | ✓ |
OCEAN__ | The ServiceNow account username. Required when using basic authentication. | ✓ | ✓ |
OCEAN__ | The ServiceNow account password. Required when using basic authentication. | ✓ | ✓ |
OCEAN__ | Default true. When set to true, the integration will create default blueprints and the Port app config mapping. | ✗ | ✗ |
OCEAN__ | The identifier of the integration that will be installed. | ✗ | ✗ |
OCEAN__ | Enable sending raw data examples from the third-party API to Port for testing and managing the integration mapping. Default is true. | ✗ | ✗ |
Here is an example for a azure-pipeline.yml pipeline file:Azure pipeline (click to expand)
- Go to the Servicenow Connectors page in your portal.
- Under Select your installation method, choose your desired CI/CD platform.
- Copy the workflow and replace the placeholders with your values.
Below are the available parameters and their descriptions.
| Parameter | Description | Required? | Secret?Store this value as a GitLab CI/CD variable |
|---|---|---|---|
OCEAN__ | Your Port client ID (How to get the credentials). | ✓ | ✓ |
OCEAN__ | Your Port client secret (How to get the credentials). | ✓ | ✓ |
OCEAN__ | Your Port API URL (https://api.port.io for EU, https://api.us.port.io for US). | ✓ | ✗ |
OCEAN__ | The ServiceNow instance URL. For example https://example-id.service-now.com. | ✓ | ✓ |
OCEAN__ | The ServiceNow OAuth client ID. Required when using OAuth authentication. | ✓ | ✓ |
OCEAN__ | The ServiceNow OAuth client secret. Required when using OAuth authentication. | ✓ | ✓ |
OCEAN__ | The ServiceNow account username. Required when using basic authentication. | ✓ | ✓ |
OCEAN__ | The ServiceNow account password. Required when using basic authentication. | ✓ | ✓ |
OCEAN__ | Default true. When set to true, the integration will create default blueprints and the Port app config mapping. | ✗ | ✗ |
OCEAN__ | The identifier of the integration that will be installed. | ✗ | ✗ |
OCEAN__ | Enable sending raw data examples from the third-party API to Port for testing and managing the integration mapping. Default is true. | ✗ | ✗ |
Live events
The ServiceNow integration supports live events for real-time catalog updates. When enabled, the integration automatically creates Business Rules in your ServiceNow instance that forward record changes to Port via an Outbound REST Message.
Enabling live events
To enable live events, set enableTablesLiveEventsWebhooks to true in your integration configuration. When enabled, the integration creates Business Rules for every supported table in your mapping configuration, or only for tables specified in liveEventTables.
For self-hosted installations, you also need to configure liveEvents.baseUrl so that ServiceNow can reach your integration instance. See the installation methods section for network configuration details.
Supported resources
The following resources support live events. Each resource receives Business Rules for insert, update, and delete operations:
| Resource | ServiceNow table | Supported events |
|---|---|---|
| Incident | incident | insert, update, delete |
| Group | sys_user_group | insert, update, delete |
| Service Catalog | sc_catalog | insert, update, delete |
| Vulnerability | sn_vul_vulnerable_item | insert, update, delete |
| Release Management | release_project | insert, update, delete |
Custom tables added to your mapping configuration that are not in the list above will not receive live events. They will still be ingested during scheduled resyncs.
Delete events and entity identifiers
For delete events to correctly resolve entities in your catalog, your mapping should use .sys_id as the entity identifier. .sys_id is the primary key for every ServiceNow record and is guaranteed to be present in all webhook payloads across all supported tables.
For example, use .sys_id as the identifier for your resources:
port:
entity:
mappings:
identifier: .sys_id
title: .short_description
blueprint: '"servicenowIncident"'
Securing webhooks
You can secure the webhook endpoint by setting the webhookSecret parameter. When configured, the integration automatically adds an Authorization header to the Outbound REST Message in ServiceNow and validates it on all incoming webhook requests.
Configuration
Port integrations use a YAML mapping block to ingest data from the third-party api into Port.
The mapping makes use of the JQ JSON processor to select, modify, concatenate, transform and perform other operations on existing fields and values from the integration API.
Default mapping configuration
This is the default mapping configuration for this integration:
Default mapping configuration (click to expand)
resources:
- kind: sys_user_group
selector:
query: 'true'
apiQueryParams:
sysparmDisplayValue: 'true'
sysparmExcludeReferenceLink: 'false'
port:
entity:
mappings:
identifier: .sys_id
title: .name
blueprint: '"servicenowGroup"'
properties:
description: .description
isActive: .active
createdOn: '.sys_created_on | (strptime("%Y-%m-%d %H:%M:%S") | strftime("%Y-%m-%dT%H:%M:%SZ"))'
createdBy: .sys_created_by
- kind: sc_catalog
selector:
query: 'true'
apiQueryParams:
sysparmDisplayValue: 'true'
sysparmExcludeReferenceLink: 'false'
port:
entity:
mappings:
identifier: .sys_id
title: .title
blueprint: '"servicenowCatalog"'
properties:
description: .description
isActive: .active
createdOn: '.sys_created_on | (strptime("%Y-%m-%d %H:%M:%S") | strftime("%Y-%m-%dT%H:%M:%SZ"))'
createdBy: .sys_created_by
- kind: incident
selector:
query: 'true'
apiQueryParams:
sysparmDisplayValue: 'true'
sysparmExcludeReferenceLink: 'false'
port:
entity:
mappings:
identifier: .sys_id
title: .short_description
blueprint: '"servicenowIncident"'
properties:
number: .number | tostring
state: .state
category: .category
reopenCount: .reopen_count
severity: .severity
assignedTo: .assigned_to.link
urgency: .urgency
contactType: .contact_type
createdOn: '.sys_created_on | (strptime("%Y-%m-%d %H:%M:%S") | strftime("%Y-%m-%dT%H:%M:%SZ"))'
createdBy: .sys_created_by
isActive: .active
priority: .priority
Mapping & selectors per resource
- kind: sys_user_group
selector:
query: "true"
apiQueryParams:
sysparmDisplayValue: 'true'
sysparmExcludeReferenceLink: 'false'
port:
entity:
mappings:
identifier: .sys_id
title: .name
blueprint: '"servicenowGroup"'
properties:
description: .description
isActive: .active
createdOn: '.sys_created_on | (strptime("%Y-%m-%d %H:%M:%S") | strftime("%Y-%m-%dT%H:%M:%SZ"))'
createdBy: .sys_created_by
{
"parent": "",
"manager": "",
"roles": "",
"sys_mod_count": "0",
"active": "true",
"description": "\n\t\tGroup for all people who have the Analytics Admin role\n\t",
"source": "",
"sys_updated_on": "2020-03-17 11:39:14",
"sys_tags": "",
"type": "",
"sys_id": "019ad92ec7230010393d265c95c260dd",
"sys_updated_by": "admin",
"cost_center": "",
"default_assignee": "",
"sys_created_on": "2020-03-17 11:39:14",
"name": "Analytics Settings Managers",
"exclude_manager": "false",
"email": "",
"include_members": "false",
"sys_created_by": "admin"
}
{
"identifier": "019ad92ec7230010393d265c95c260dd",
"title": "Analytics Settings Managers",
"icon": "ServiceNow",
"blueprint": "servicenowGroup",
"team": [],
"properties": {
"description": "\n\t\tGroup for all people who have the Analytics Admin role\n\t",
"isActive": true,
"createdOn": "2020-03-17T11:39:14Z",
"createdBy": "admin"
},
"relations": {},
"createdAt": "2023-12-18T08:37:21.637Z",
"createdBy": "hBx3VFZjqgLPEoQLp7POx5XaoB0cgsxW",
"updatedAt": "2023-12-18T08:37:21.637Z",
"updatedBy": "hBx3VFZjqgLPEoQLp7POx5XaoB0cgsxW"
}
Set up live events
This integration supports live events, allowing real-time updates to your software catalog without waiting for the next scheduled sync.
Note that different events are supported depending on the resource type.
insertupdatedeleteinsertupdatedeleteinsertupdatedeleteinsertupdatedeleteinsertupdatedelete- Hosted by Port
- Self-hosted
Live events base URL
For integrations installed using the Hosted by Port method, you can obtain the live events base URL from the Get an integration API. The response includes liveEventsUuid and liveEventsIngestHostname in the appSpec section.
Call the endpoint with your integration's identifier:
curl -X GET \
'https://api.port.io/v1/integration/<INTEGRATION_IDENTIFIER>' \
-H 'Authorization: Bearer <PORT_ACCESS_TOKEN>'
The port_region, port.baseUrl, portBaseUrl, port_base_url and OCEAN__PORT__BASE_URL parameters select which Port API instance to use:
- EU (app.port.io) →
https://api.port.io - US (app.us.port.io) →
https://api.us.port.io
In the response, look for the following fields under spec.appSpec:
{
"spec": {
"appSpec": {
"liveEventsUuid": "abcdefghijk",
"liveEventsIngestHostname": "ingest.ocean.getport.io"
}
}
}
Combine them to build the live events base URL:
https://<liveEventsIngestHostname>/live-events/<liveEventsUuid>
For example, with the values above, the live events base URL is:
https://ingest.ocean.getport.io/live-events/abcdefghijk
This is the same URL configured for the integration.
BaseUrl & webhook configuration
To enable real-time updates of the data in your software catalog, you need to define the liveEvents.baseUrl parameter.
This parameter should be set to the URL of your ServiceNow integration instance, which needs to have the option to setup webhooks via HTTP requests/receive HTTP requests, so ensure the network is configured accordingly.
- If ServiceNow and the integration are in the same cluster/network: Use an internal URL (e.g., a Kubernetes service DNS name).
For Kubernetes deployments, create a service to expose the integration pod and use the service URL asliveEvents.baseUrl. If both the source system and integration are in the same cluster, an internal ClusterIP service is sufficient. - If ServiceNow is external to the integration's network: The integration must be exposed via an ingress, load balancer, or public URL that ServiceNow can reach.
If you're running high volumes of live events in a self-hosted deployment and want better reliability, event durability, or horizontal scalability, you can optionally set up Port's dedicated live events infrastructure. See live events at scale for details.
If liveEvents.baseUrl is not provided, the integration will continue to function correctly. In such a configuration, to retrieve the latest information from the target system, the scheduledResyncInterval parameter has to be set, or a manual resync will need to be triggered through Port's UI.
To test webhooks or live event delivery to your local environment, expose your local pod or service to the internet using ngrok (e.g. ngrok http http://localhost:8000)
Filter ServiceNow resources
Port's ServiceNow integration provides an option to filter the data that is retrieved from the ServiceNow Table API using the following attributes:
-
sysparmDisplayValue: Determines the type of data returned, either the actual values from the database or the display values of the fields. The default istrue -
sysparmFields: Comma-separated list of fields to return in the response -
sysparmExcludeReferenceLink: Flag that indicates whether to exclude Table API links for reference fields. The default isfalse -
sysparmQuery: Encoded query used to filter the result set. The syntax is<col_name><operator><value>:<col_name>: Name of the table column to filter against<operator>: =, !=, ^, ^OR, LIKE, STARTSWITH, ENDSWITH,ORDERBY<col_name>,ORDERBYDESC<col_name><value>: Value to match against
Queries can be chained using ^ or ^OR for AND/OR logic. An example query could be this:
active=true^nameLIKEdev^urgency=3which returns all active incidents with an urgency level of 3 and have a name likedev
The filtering attributes described above can be enabled using the selector.apiQueryParams path, for example:
- kind: <name of table>
selector:
query: "true"
apiQueryParams:
sysparmDisplayValue: 'true'
sysparmExcludeReferenceLink: 'false'
sysparmQuery: active=true^nameLIKEdev^urgency=3
sysparmFields: sys_id,priority,created_by,state,active
Monitoring and sync status
To learn more about how to monitor and check the sync status of your integration, see the relevant documentation.
Relevant Guides
For relevant guides and examples, see the guides section.