Skip to main content
Skip table of contents

ServiceNow Guide

ServiceNow is a cloud-based software platform for IT Service Management (ITSM) using intelligent workflows. This guide explains how to add ServiceNow integration to Cloudaware.

ServiceNow guide - CA_logo_black.png To see how Cloudaware seamlessly integrates with ServiceNow in action, request a demo.

Introduction

Cloudaware can both push data on demand into ServiceNow and act as a repository that ServiceNow can pull from a scheduled basis. While many off-the-shelf tools provide ServiceNow–Salesforce integration, none of them are required for Cloudaware/Salesforce and ServiceNow to exchange data.

Architecture

This architecture supports the following use cases:

  • Cloudaware forwards a change request to ServiceNow

  • ServiceNow retrieves a list of violations from Cloudaware and saves them as incidents.

The following SOAP roles are supported on both sides:

CODE
soap

Can perform all SOAP operations

CODE
soap_create

Can insert new records

CODE
soap_delete

Can delete existing records

CODE
soap_ecc

Can query, insert, and delete records on the qs.

CODE
soap_query

Can query record information

CODE
soap_query_update

Can query record information and update records

CODE
soap_script

Can run scripts that specify a .do endpoint

CODE
soap_update

Can update records

Prerequisites

Complete the following steps before setting up the integration in ServiceNow and Cloudaware.

  1. Create a user in Cloudaware/Salesforce.

  2. Add the ServiceNow IP to the trusted IP range in Cloudaware/Salesforce.

  3. Export the Partner WSDL from Cloudaware/Salesforce.

Create a Salesforce user

  1. Log in to Cloudaware → Setup.

  2. In the Quick Find bar, enter Users, and then select Users. Click New User.

  3. Enter a name, e.g., ServiceNow Collector. Provide an email address and a unique username in email format. By default, the username is the same as the email address.

  4. Select a User License, which determines which profiles are available for the user: Salesforce or Salesforce Platform.

  5. Select a standard User Profile, which specifies the user’s minimum permissions and access settings: CloudAware User/Standard Platform User.

  6. Check the 'Generate new password and notify user immediately' box to send login details and the temporary password to the user.

Add IP to trusted IP range in Salesforce

  1. Go back to Setup.

  2. In the Quick Find bar, enter Security Controls, and then select Network Access. Click New.

  3. Add Start IP Address and End IP Address. Click Save.

Export Partner WSDL

  1. Go back to Setup.

  2. In the Quick Find box, enter API, and then select API.

  3. Find Partner WSDL. Click Generate Partner WSDL.

    ServiceNow - ServiceNow guide - partner WSDL.png

  4. Save the generated WSDL XML file to your workstation.  

Setup in ServiceNow


This is the most common way Cloudaware data is populated into CMDB. It allows ServiceNow administrators to control mapping of objects collected from Cloudaware.

The steps:

  1. Upload the WSDL to ServiceNow System SOAP Outbound Messages.

  2. Configure scripts to export data from Cloudaware to ServiceNow.

Upload WSDL to ServiceNow

  1. Log in to the ServiceNow instance.

  2. Go to System Web Services.

  3. Navigate to Outbound → SOAP Message. Click New.

    ServiceNow - ServiceNow guide - System Web Services.png

  4. In the Outbound SOAP Message form:

  • Enter a meaningful name

  • Uncheck the box 'Download WSDL'

  • Paste the XML from the Export Partner WSDL step

  • Click Generate sample SOAP Messages.

    ServiceNow - ServiceNow guide - SOAP message form.png


    If the WSDL is imported successfully, SOAP Message Functions will appear. Allow some time for all functions to load. Note that the number of SOAP message functions can change over time.

    ServiceNow - ServiceNow guide - SOAP аunctions.png

Get Cloudaware/Salesforce session ID

All data retrieval operations require a session ID. To obtain it:

  1. Locate and select the login outbound SOAP message.

    ServiceNow - ServiceNow guide - login SOAP message.png

  2. In the message form, add Username and Password+SecurityToken* in the envelope body. For example, if the password = qwerty and the token = token, enter qwertytoken.

    ServiceNow - ServiceNow guide - username and password.png

*To generate a security token, log in as the ServiceNow Collector user (see the step Create Salesforce User above). Go to Settings Personal Reset My Security Token → click Reset Security Token. The token is emailed to the user. NOTE: The token reset must be done only for the collector user that was created specifically for this integration!

  1. Click Test. An HTTP 200 response confirms success.

  2. Copy the <serverUrl> and <sessionId> values for later use.

    ServiceNow - ServiceNow guide - 200 response with session id hidden.png


    Save the values as they will be required later.

Query and insert data

After the login request succeeds, you can retrieve data from Cloudaware/Salesforce into ServiceNow into any ServiceNow object, such as:

  • EC2 Load Balancers -> EC2 Load Balancer records in ServiceNow

  • Cloudaware Policy Violations -> ServiceNow Incidents

  • Cloudaware Changes → ServiceNow Change Requests


Steps:

  1. Under Outbound SOAP Messages, go to Functions. Select query.

    ServiceNow - ServiceNow guide - query function.png

  2. Click the Lock sign to edit the SOAP endpoint URL. Insert the link copied from <serverUrl> earlier.

    ServiceNow - ServiceNow guide - edit SOAP endpoint URL.png

  3. Remove the following query part from <urn:MruHeader> through <urn:SessionHeader> in the Envelope body message:

    CODE
          <urn:MruHeader>
             <urn:updateMru>${MruHeader.updateMru}</urn:updateMru>
          </urn:MruHeader>
          <urn:QueryOptions>
             <!--Optional:-->
             <urn:batchSize>${QueryOptions.batchSize}</urn:batchSize>
          </urn:QueryOptions>
          <urn:CallOptions>
             <urn:client>${CallOptions.client}</urn:client>
             <urn:defaultNamespace>${CallOptions.defaultNamespace}</urn:defaultNamespace>
          </urn:CallOptions>


    The Envelope body message must look as follows:

    CODE
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:partner.soap.sforce.com">
       <soapenv:Header>
    
          <urn:SessionHeader>
             <urn:sessionId>SAMPLESESSIONID</urn:sessionId>
          </urn:SessionHeader>
       </soapenv:Header>
       <soapenv:Body>
          <urn:query>
             <urn:queryString>SELECT CA10__vmId__c, Name, CA10__osType__c, CA10__breezeIsActive__c, CA10__powerState__c, CA10__roleSizeName__c FROM CA10__CaAzureVirtualMachine__c WHERE CA10__disappearanceTime__c = null</urn:queryString>
          </urn:query>
       </soapenv:Body>
    </soapenv:Envelope>

    WHERE SAMPLESESSIONID is a placeholder for the session ID copied from <sessionId>.

  4. Type the query after urn:queryString to specify data that will be extracted (see the example below). Click Test.

    ServiceNow - ServiceNow guide - query and test with session id hidden.png

You can use different queries to extract different pieces of data from Cloudaware. Here are some examples: 

AWS EC2 Instance:

CODE
SELECT CA10__instanceId__c, Name, CA10__platform__c, CA10__instanceType__c FROM CA10__CaAwsInstance__c LIMIT 10

Azure Virtual Machine: 

CODE
SELECT CA10__vmId__c, Name, Subscription_Name__c, CA10__osType__c, CA10__breezeIsActive__c, CA10__powerState__c, CA10__roleSizeName__c FROM CA10__CaAzureVirtualMachine__c WHERE CA10__disappearanceTime__c = null

vCenter Virtual Machine: 

CODE
SELECT Name, CA10V__virtualMachineId__c, CA10V__hostId__c, CA10V__powerState__c, CA10V__cpuCount__c, CA10V__memorySizeMiB__c FROM CA10V__CaVCenterVirtualMachine__c WHERE CA10V__disappearanceTime__c = null

Additional examples:

CODE
SELECT Id, Name, CA10__subject__c FROM CA10__CaPolicyViolation__c LIMIT 10 
CODE
SELECT Id, Subject FROM Case 
CODE
SELECT Id, Name, CA10__accountId__c FROM CA10__CaAwsAccount__c 
CODE
SELECT Id, Name, CA10__arn__c, CA10__mfaEnableDate__c, CA10__lastLoginDateTime__c FROM CA10__CaAwsUser__c 

For a reference list of all fields, contact your account manager via tam@cloudaware.com or download Enterprise WSDL from the step Export Partner WSDL.

Note that a query returns 500-2000 records depending on batch size. More about limits

Setup in Cloudaware

  1. Log in to Cloudaware → Admin.

    ServiceNow - ServiceNow guide - admin.png

  2. Find ServiceNow in Issue Management integrations. Click +ADD.

    ServiceNow - ServiceNow guide - admin - add integration.png

  3. Fill out the form:

    ServiceNow - ServiceNow guide - integration form.png

    WHERE
    Authentication type – select Basic for using username/password, or OAuth for token-based authentification
    URL – the ServiceNow instance URL in the form https://<your-instance>.service-now.com
    Username – the ServiceNow username
    Password – the ServiceNow password
    Client Id (for OAuth only) – the identifier generated in Application Registry when registering the OAuth client
    Client Secret (for OAuth only) – the secret generated in Application Registry when registering the OAuth client

    Click SAVE.

  4. A green light in the ‘Status’ column indicates successful configuration. If the light is red, contact support@cloudaware.com.

    ServiceNow - ServiceNow guide - integration status.png

Cloudaware can also initiate API calls to ServiceNow inside workflows, triggers, and actions. For example, a change request in Cloudaware can be submitted in real time to ServiceNow using an outbound message. The outbound message functionality is described here.

Contrary to the previous example, Inbound SOAP Messages can be configured in ServiceNow and referenced in Cloudaware.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.