# Using the ServiceNow Adapter Console Application

The Console Application of ServiceNow Adapter is a command-line application that contains various commands for executing background and configuration tasks to extract, load, and process data from the Open iT database to the ServiceNow instance.

# ServiceNow Adapter Console Application Tasks

To show the available task, follow these instructions:

  1. Open a command prompt and run the following command to go to the installation directory of the ServiceNow Adapter, which is by default in C:\Program Files\OpeniT\ServiceNow Adapter\:

    cd "C:\Program Files\OpeniT\ServiceNow Adapter\"
  2. Once in the directory, run the following command:

    OpeniT.Adapter.Console.exe

    This will display the available options.

    ServiceNow Adapter for Open iT Integration, 1.0.0. Copyright 2023 Open iT, Inc. All rights reserved. 
    
    Sql Database: ServiceNow @ OSL120WIN\SQL2019E
    
    2023-09-19 23:07:04,853 +08:00 INFO Productinfo - License file is valid. "servicenow" valid until 2024-07-01 (285 days)
    2023-09-19 23:07:04,926 +08:00 INFO Productinfo - ServiceNow Adapter for Open iT Integration Version: 1.0.0 (1365a986)
    
    Usage: OpeniT.Adapter.Console <subcommand> [args]
    Type 'OpeniT.Adapter.Console help <subcommand>' for help on a specific subcommand.
    
    Available subcommands:
    
    DeploySchema    Deploy SQL database schema to either the latest or a specific version.
    ProcessData     Process Open iT Datatypes and load to staging tables for integration.
    Configure       Configure ServiceNow-required details
    PushData        Fetch data from Open iT Database and push to ServiceNow instance.
    TestConnection  Test connection to ServiceNow instance.
    RunAdapter      Run all processing jobs

    To show the available parameters for each command, add a help parameter before the command. Use the following syntax:

    OpeniT.Adapter.Console.exe help deployschema

    This command displays the available options.

    ServiceNow Adapter for Open iT Integration, 1.0.0. Copyright 2023 Open iT, Inc. All rights reserved.
    
    Sql Database: ServiceNow @ OSL120WIN\SQL2019E
    
    2023-09-19 23:07:04,853 +08:00 INFO Productinfo - License file is valid. "servicenow" valid until 2024-07-01 (285 days)
    2023-09-19 23:07:04,926 +08:00 INFO Productinfo - ServiceNow Adapter for Open iT Integration Version: 1.0.0 (1365a986)
    
    Deploy SQL database schema to either the latest or a specific version.
    usage: OpeniT.Adapter.Console DeploySchema [/version:value] [/trace]
        [/version:value]    Specific version to migrate to
        [/trace]            Enable tracing of SQL statements.

# Available Tasks

# Deploying Database Schema in SQL Server (DeploySchema)

This command creates all the necessary SQL objects for data processing. It includes creating tables, stored procedures, and static data for specific tables.

To execute the command, follow these instructions:

  1. Open a command prompt and run the following command to go to the installation directory of the ServiceNow Adapter, which is by default in C:\Program Files\OpeniT\ServiceNow Adapter\:

    cd "C:\Program Files\OpeniT\ServiceNow Adapter\"

  2. Once in the directory, run the following command:

    OpeniT.Adapter.Console.exe DeploySchema

    To further customize the command, use the optional parameters.

    OpeniT.Adapter.Console.exe DeploySchema [/version:value] [/trace]

    Optional Parameters:

    /version:[migration_version]
    This parameter limits the migration of the database to the specified version. The migration version format is YYYYMMDDHHMMSS.

    Example
    OpeniT.Adapter.Console.exe DeploySchema /version:20220101143000

    /trace
    This parameter triggers the command to display SQL statements.

    Example
    OpeniT.Adapter.Console.exe DeploySchema /trace

    Combine or use optional parameters at the same time to achieve necessary capabilities.

    Example
    OpeniT.Adapter.Console.exe DeploySchema /version:20220101143000 /trace

  3. The Console Application will display information messages in the command prompt. Allow the process to finish.

# Processing Data from Open iT SQL Database (ProcessData)

This command fetches data from specific data types in the Analysis Server database and loads it to the ServiceNow staging tables.

To execute the command, follow these instructions:

  1. Open a command prompt and run the following command to go to the installation directory of the ServiceNow Adapter, which is by default in C:\Program Files\OpeniT\ServiceNow Adapter\:

    cd "C:\Program Files\OpeniT\ServiceNow Adapter\"

  2. Once in the directory, run the following command:

    OpeniT.Adapter.Console.exe ProcessData

    To further customize the command, use the optional parameter.

    OpeniT.Adapter.Console.exe ProcessData [/fullwipe]

    Optional Parameter:

    /fullwipe
    This parameter triggers the command to delete all processed and cached data.

    Example
    OpeniT.Adapter.Console.exe ProcessData /fullwipe

  3. The Console Application will display information messages in the command prompt. Allow the process to finish.

# Configuring ServiceNow Settings (Configure)

This command contains various subcommands to configure necessary ServiceNow settings for a successful API connection.

To see the options, follow these instructions:

  1. Open a command prompt and run the following command to go to the installation directory of the ServiceNow Adapter, which is by default in C:\Program Files\OpeniT\ServiceNow Adapter\:

    cd "C:\Program Files\OpeniT\ServiceNow Adapter\"

  2. Once in the directory, run the following command:

    OpeniT.Adapter.Console.exe Configure

    The console application will display the available options.

    ServiceNow Adapter for Open iT Integration, 1.0.0. Copyright 2023 Open iT, Inc. All rights reserved.
    
    Sql Database: ServiceNow @ OSL120WIN\SQL2019E
    
    2023-09-19 19:14:52,194 +08:00 INFO Productinfo - License file is valid. "servicenow" valid until 2024-07-01 (285 days)
    2023-09-19 19:14:53,243 +08:00 INFO Productinfo - ServiceNow Adapter for Open iT Integration Version: 1.0.0 (1365a986)
    
    Current ServiceNow Configurations
    
    ServiceNow Instance URI: https://dev165816.service-now.com/
    Authentication Type: basic
    Username: user1
    
    [1]: Set ServiceNow instance URI
    [2]: Set Authentication
    [3]: Test Connection
    [4]: Save configuration
    [0]: Exit
    
    Select:

  3. Select from options 1 to 4, then press Enter.

  4. The Console Application will display information messages in the command prompt. Allow the process to finish.

# Configure - [1] Set ServiceNow instance URI

This Configure subcommand updates the value of the ServiceNow instance URI. The initial value is the one provided upon installation.

To execute the subcommand, follow these instructions:

  1. Follow the instructions given in the Configure section.

  2. Select option 1.

  3. Provide a valid ServiceNow instance URI.

    ServiceNow Adapter for Open iT Integration, 1.0.0. Copyright 2023 Open iT, Inc. All rights reserved.
    
    Sql Database: ServiceNow @ OSL120WIN\SQL2019E
    
    2023-09-19 19:14:52,194 +08:00 INFO Productinfo - License file is valid. "servicenow" valid until 2024-07-01 (285 days)
    2023-09-19 19:14:53,243 +08:00 INFO Productinfo - ServiceNow Adapter for Open iT Integration Version: 1.0.0 (1365a986)
    
    Current ServiceNow Configurations
    
    ServiceNow Instance URI: https://dev165816.service-now.com/
    Authentication Type: basic
    Username: user1
    
        [1]: Set ServiceNow instance URI
        [2]: Set Authentication
        [3]: Test Connection
        [4]: Save configuration
        [0]: Exit
    
    Select:1
    ServiceNow instance URI [https://dev165816.service-now.com/]:

    The current ServiceNow instance URI is displayed inside the square brackets. Press Enter to use the value.


  4. Select option 4 to save the changes.

    The application will test the connection using the provided configuration. If the connection fails, a prompt will be displayed.

        [1]: Set ServiceNow instance URI
        [2]: Set Authentication
        [3]: Test Connection
        [4]: Save configuration
        [0]: Exit
    
    Select: 4
    
    2023-09-19 19:35:10,352 +08:00 INFO Actions - ServiceNow URI:
    https://dev165816.service-now.com/
    2023-09-19 19:35:10,370 +08:00 INFO Actions - Authentication
    Type: basic
    
    2023-09-19 19:35:10,385 +08:00 INFO Actions - Validating supplied/saved configurations.
    2023-09-19 19:35:10,395 +08:00 INFO Actions - Testing supplied configurations...
    2023-09-19 19:35:11,872 +08:00 ERROR Actions - Credentials supplied is invalid!
    2023-09-19 19:35:11,890 +08:00 ERROR Actions - Connect response:
        {"error":{"message":"User Not Authenticated","detail":"Required to provide Auth information"},"status":"failure"}
    2023-09-19 19:35:11,899 +08:00 ERROR Actions - Cannot connect using supplied credentials!
    
    Would like to continue saving [y/n]? [y]:

  5. Type y (or press Enter) to continue saving. Allow the process to finish.

# Configure - [2] Set Authentication - [1] Basic Authentication

This Configure subcommand updates the Authentication Type to Basic Authentication and the credentials used to connect to the ServiceNow instance.

To execute the subcommand, follow these instructions:

  1. Follow the instructions given in the Configure section.

  2. Select option 2.

  3. The available Authentication Types will be displayed. Select 1.

    ServiceNow Adapter for Open iT Integration, 1.0.0. Copyright 2023 Open iT, Inc. All
    rights reserved. http://www.openit.com
    
    Sql Database: ServiceNow @ OSL120WIN\SQL2019E
    
    2023-09-19 23:07:04,853 +08:00 INFO Productinfo - License file is valid. "servicenow" valid until 2024-07-01 (285 days)
    2023-09-19 23:07:04,926 +08:00 INFO Productinfo - ServiceNow Adapter for Open iT Integration Version: 1.0.0 (1365a986)
    
    Current ServiceNow Configurations
    
    ServiceNow Instance URI: https://dev165816.service-now.com/
    Authentication Type: basic
    Username: user1
    
        [1]: Set ServiceNow instance URI
        [2]: Set Authentication
        [3]: Test Connection
        [4]: Save configuration
        [0]: Exit
    
    Select: 2
    
    Set ServiceNow Authentication Type
        [1]: Basic Authentication
        [2]: Bearer Authentication
        [3]: Oauth2 Authentication
        [0]: Exit
    
    Select [1][basic]:1

    The current Authentication Type is displayed inside the square brackets. Press Enter to use the value.


  4. Provide the credentials to use in connecting.

    Basic Authentication Details
    Username: user1
    Password (in clear text): p@$$w0Rd

  5. Select option 4 to save the changes.

    The application will test the connection using the provided configuration. If the connection fails, a prompt will be displayed.

        [1]: Set ServiceNow instance URI
        [2]: Set Authentication
        [3]: Test Connection
        [4]: Save configuration
        [0]: Exit
    
    Select: 4
    
    2023-09-19 19:35:10,352 +08:00 INFO Actions - ServiceNow URI:
    https://dev165816.service-now.com/
    2023-09-19 19:35:10,370 +08:00 INFO Actions - Authentication
    Type: basic
    
    2023-09-19 19:35:10,385 +08:00 INFO Actions - Validating supplied/saved configurations.
    2023-09-19 19:35:10,395 +08:00 INFO Actions - Testing supplied configurations...
    2023-09-19 19:35:11,872 +08:00 ERROR Actions - Credentials supplied is invalid!
    2023-09-19 19:35:11,890 +08:00 ERROR Actions - Connect response:
        {"error":{"message":"User Not Authenticated","detail":"Required to provide Auth information"},"status":"failure"}
    2023-09-19 19:35:11,899 +08:00 ERROR Actions - Cannot connect using supplied credentials!
    
    Would like to continue saving [y/n]? [y]:

  6. Type y (or press Enter) to continue saving. Allow the process to finish.

# Configure - [2] Set Authentication - [2] Bearer Authentication

This Configure subcommand updates the Authentication Type to Bearer Authentication and the credentials used to connect to the ServiceNow instance.

To execute the subcommand, follow these instructions:

  1. Follow the instructions given in the Configure section.

  2. Select option 2.

  3. The available Authentication Types will be displayed. Select 2.

    ServiceNow Adapter for Open iT Integration, 1.0.0. Copyright 2023 Open iT, Inc. All
    rights reserved. http://www.openit.com
    
    Sql Database: ServiceNow @ OSL120WIN\SQL2019E
    
    2023-09-19 23:07:04,853 +08:00 INFO Productinfo - License file is valid. "servicenow" valid until 2024-07-01 (285 days)
    2023-09-19 23:07:04,926 +08:00 INFO Productinfo - ServiceNow Adapter for Open iT Integration Version: 1.0.0 (1365a986)
    
    Current ServiceNow Configurations
    
    ServiceNow Instance URI: https://dev165816.service-now.com/
    Authentication Type: basic
    Username: user1
    
       [1]: Set ServiceNow instance URI
       [2]: Set Authentication
       [3]: Test Connection
       [4]: Save configuration
       [0]: Exit
    
    Select: 2
    
    Set ServiceNow Authentication Type
       [1]: Basic Authentication
       [2]: Bearer Authentication
       [3]: Oauth2 Authentication
       [0]: Exit
    
    Select [2][bearer]: 2

    The current Authentication Type is displayed inside square brackets. Press Enter to use the value.


  4. Provide the Bearer Token used in connecting.

    Bearer Authentication Details
    Bearer Token (in clear text): YmvtmaPJrVB_gLfUdGgMZkM_DPLROwKKc8TtSSBEqP4DbbZjfuN4zUDIH3ht2jjRF

  5. Select option 4 to save the changes.

    The application will test the connection using the provided configuration. If the connection fails, a prompt will be displayed.

        [1]: Set ServiceNow instance URI
        [2]: Set Authentication
        [3]: Test Connection
        [4]: Save configuration
        [0]: Exit
    
    Select: 4
    
    2023-09-19 19:35:10,352 +08:00 INFO Actions - ServiceNow URI: https://dev165816.service-now.com/
    2023-09-19 19:35:10,370 +08:00 INFO Actions - Authentication Type: bearer
    2023-09-19 19:35:10,385 +08:00 INFO Actions - Validating supplied/saved configurations.
    2023-09-19 19:35:10,395 +08:00 INFO Actions - Testing supplied configurations...
    2023-09-19 19:35:11,872 +08:00 ERROR Actions - Credentials supplied is invalid!
    2023-09-19 19:35:11,890 +08:00 ERROR Actions - Connect response:
        {"error":{"message":"User Not Authenticated","detail":"Required to provide Auth information"},"status":"failure"}
    2023-09-19 19:35:11,899 +08:00 ERROR Actions - Cannot connect using supplied credentials!
    
    Would like to continue saving [y/n]? [y]:

  6. Type y (or press Enter) to continue saving. Allow the process to finish.

# Configure - [2] Set Authentication - [3] OAuth2 Authentication

This Configure subcommand updates the Authentication Type to OAuth2 Authentication and credentials used to connect to the ServiceNow instance.

To execute the subcommand, follow these instructions:

  1. Follow the instructions given in the Configure section.

  2. Select option 2.

  3. The available Authentication Types will be displayed. Select 3.

    ServiceNow Adapter for Open iT Integration, 1.0.0. Copyright 2023 Open iT, Inc. All rights reserved. http://www.openit.com
    
    Sql Database: ServiceNow @ OSL120WIN\SQL2019E
    
    2023-09-19 23:19:14,492 +08:00 INFO Productinfo - License file is valid. "servicenow" valid until 2024-07-01 (285 days)
    2023-09-19 23:19:14,593 +08:00 INFO Productinfo - ServiceNow Adapter for Open iT Integration Version: 1.0.0 (1365a986)
    
    Current ServiceNow Configurations
    
    ServiceNow Instance URI: https://dev165816.service-now.com/
    Authentication Type: basic
    Username: user1
    
        [1]: Set ServiceNow instance URI
        [2]: Set Authentication
        [3]: Test Connection
        [4]: Save configuration
        [0]: Exit
    
    Select: 2
    
    Set ServiceNow Authentication Type
        [1]: Basic Authentication
        [2]: Bearer Authentication
        [3]: Oauth2 Authentication
        [0]: Exit
    
    Select [3][oauth2]: 3

  4. Provide the credentials used to connect.

    Oauth2 Authentication Details
    Username: user1
    Password (in clear text): p@$$w0Rd
    Client Id: 9390a749d288f1109b4f0825be53a43a
    Client Secret (in clear text): s3cReT

  5. Select option 4 to save the changes.

    The application will test the connection using the provided configuration. If the connection fails, a prompt will be displayed.

        [1]: Set ServiceNow instance URI
        [2]: Set Authentication
        [3]: Test Connection
        [4]: Save configuration
        [0]: Exit
        Select: 4
    
    2023-09-19 19:35:10,352 +08:00 INFO Actions - ServiceNow URI: https://dev165816.service-now.com/
    2023-09-19 19:35:10,370 +08:00 INFO Actions - Authentication Type: oauth2
    2023-09-19 19:35:10,385 +08:00 INFO Actions - Validating supplied/saved configurations.
    2023-09-19 19:35:10,395 +08:00 INFO Actions - Testing supplied configurations...
    2023-09-19 19:35:11,872 +08:00 ERROR Actions - Credentials supplied is invalid!
    2023-09-19 19:35:11,890 +08:00 ERROR Actions - Connect response:
        {"error":{"message":"User Not Authenticated","detail":"Required to provide Auth information"},"status":"failure"}
    2023-09-19 19:35:11,899 +08:00 ERROR Actions - Cannot connect using supplied credentials!
    
    Would like to continue saving [y/n]? [y]:

  6. Type y (or press Enter) to continue saving. Allow the process to finish.

# Configure - [3] Test Connection

This Configure subcommand triggers a test connection to the ServiceNow instance using the provided configuration in the session. This is useful for testing the provided configuration before saving.

To execute the subcommand, follow these instructions:

  1. Follow the instructions given in the Configure section.

  2. Select option 3.

    ServiceNow Adapter for Open iT Integration, 1.0.0. Copyright 2023 Open iT, Inc. All rights reserved. http://www.openit.com
    
    Sql Database: ServiceNow @ OSL120WIN\SQL2019E
    
    2023-09-19 23:19:14,492 +08:00 INFO Productinfo - License file is valid. "servicenow" valid until 2024-07-01 (285 days)
    2023-09-19 23:19:14,593 +08:00 INFO Productinfo - ServiceNow Adapter for Open iT Integration Version: 1.0.0 (1365a986)
    
    Current ServiceNow Configurations
    
    ServiceNow Instance URI: https://dev165816.service-now.com/
    Authentication Type: basic
    Username: user1
    
        [1]: Set ServiceNow instance URI
        [2]: Set Authentication
        [3]: Test Connection
        [4]: Save configuration
        [0]: Exit
    
    Select: 3

    The application will test the connection using the ServiceNow instance URI and authentication of the current session. The current configurations will be used if the current session has no configuration values.

    It will display Connection Successful if it successfully connects to the ServiceNow instance; otherwise, it will display Connection Failed and additional information on the failed connection.

# Testing the Connection to the ServiceNow Instance

This command triggers a connection test to the configured ServiceNow instance.

To execute the command, follow these instructions:

  1. Open a command prompt and run the following command to go to the installation directory of the ServiceNow Adapter, which is by default in C:\Program Files\OpeniT\ServiceNow Adapter\:

    cd "C:\Program Files\OpeniT\ServiceNow Adapter\"

  2. Once in the directory, run the following command:

    OpeniT.Adapter.Console.exe TestConnection

  3. The Console Application will display information messages in the command prompt. Allow the process to finish.

# Sending Processed Data to the ServiceNow Instance (PushData)

This command fetches data from various Open iT data types in the Open iT database and sends it to the ServiceNow instance.

To execute the command, follow these instructions:

  1. Open a command prompt and run the following command to go to the installation directory of the ServiceNow Adapter, which is by default in C:\Program Files\OpeniT\ServiceNow Adapter\:

    cd "C:\Program Files\OpeniT\ServiceNow Adapter\"

  2. Once in the directory, run the following command:

    OpeniT.Adapter.Console.exe PushData

  3. The Console Application will display information messages in the command prompt. Allow the process to finish.

# Running All the Adapter Processing Jobs (RunAdapter)

This command is a combination of data processing commands – ProcessData and PushData. It is used for scheduling background data processing.

To execute the command, follow these instructions:

  1. Open a command prompt and run the following command to go to the installation directory of the ServiceNow Adapter, which is by default in C:\Program Files\OpeniT\ServiceNow Adapter\:

    cd "C:\Program Files\OpeniT\ServiceNow Adapter\"

  2. Once in the directory, run the following command:

    OpeniT.Adapter.Console.exe RunAdapter

    To further customize the command, use the optional parameter.

    OpeniT.Adapter.Console.exe RunAdapter [/fullwipe]

    Optional Parameter:

    /fullwipe
    This parameter triggers the command to wipe all processed and cached data before loading and processing data.

    Example
    OpeniT.Adapter.Console.exe RunAdapter /fullwipe

  3. The Console Application will display information messages in the command prompt. Allow the process to finish.

# ServiceNow Adapter Console Configuration

Use these procedures to configure how the ServiceNow Adapter extracts and processes data.

# Setting the Number of Month Offset

The ServiceNow Adapter extracts and processes 3 months of data by default. The range is from the current month to two (2) months back. For example, if the current month is October, it will extract data from August to October.

To set the number of month offset, follow these instructions:

  1. Log in to the Open iT Analysis Server web interface.

  2. Navigate to Administration > Configuration.

  3. Locate configuration key Root.ServiceNow.MonthOffset.

  4. Click the value to make it editable.

  5. Set the value to the desired number of months to include in extraction and processing.

  6. Click Save to apply the changes.

    ServiceNow Integration: Setting Months Offset

    ServiceNow Integration: Setting Months Offset

  7. Click the Reset Session button at the bottom of the configuration table.

    ServiceNow Integration: Reset Session

    ServiceNow Integration: Reset Session

# Setting the Number of Days for Data Keeping

The ServiceNow Adapter defaults to keeping data active for 90 days. All data not seen for 90 days is set to inactive.

To set the number of days to keep the unseen data, follow these instructions:

  1. Log in to the Open iT Analysis Server web interface.

  2. Navigate to Administration > Configuration.

  3. Locate configuration key Root.ServiceNow.KeepStaleRecord.

  4. Click the value to make it editable.

  5. Set the value to the desired maximum number of days to keep the stale data.

  6. Click Save to apply the changes.

    ServiceNow Integration: Setting Keep Stale Record

    ServiceNow Integration: Setting Keep Stale Record

  7. Click the Reset Session button at the bottom of the configuration table.

    ServiceNow Integration: Reset Session

    ServiceNow Integration: Reset Session

We value your feedback!

Please take a few minutes to complete our survey and share your thoughts on your recent experience with our documentation.

Take survey

Close