ServiceNow Connector Reference¶
The following operations allow you to work with the ServiceNow Connector. Click an operation name to see parameter details and samples on how to use it.
Initialize the connector¶
To use the ServiceNow connector, add the
The ServiceNow API requires all requests to be authenticated as a user. User has to create a own instance with his user credentials. When u create a account in ServiceNow Developer page then you are enable to create your own instance. For more information, see the ServiceNow Developer page.
servicenow.init
The servicenow.init operation initializes the connector to interact with the ServiceNow API. For more information, see the API documentation.
Parameter Name | Description | Required |
---|---|---|
serviceNowInstanceURL | The base endpoint URL of the ServiceNow API. | Yes. |
username | The user Name of the own instance. | Yes. |
password | The Password of the own instance. | Yes. |
Sample configurations
<servicenow.init>
<serviceNowInstanceURL>{$ctx:serviceNowInstanceURL}</serviceNowInstanceURL>
<username>{$ctx:username}</username>
<password>{$ctx:password}</password>
</servicenow.init>
Sample request
{
"serviceNowInstanceURL":"https://dev17686.service-now.com",
"username":"admin",
"password":"12345"
}
Aggregate API¶
servicenow.getAggregateRecord
The getAggregateRecord operation allows you to compute aggregate statistics about existing table and column data.
Parameter Name | Description | Required |
---|---|---|
tableName | Name of the table you want to retrieve a record. | Yes. |
sysparmAvgFields | A comma-separated list of fields for which to calculate the average value. | Yes. |
sysparmMinFields | A comma-separated list of fields for which to calculate the minimum value. | Yes. |
sysparmMaxFields | A comma-separated list of fields for which to calculate the maximum value. | Yes. |
sysparmCount | You can set this parameter to true for the number of records returned by the query. | Yes. |
sysparmSumFields | A comma-separated list of fields for which to calculate the sum of the values. | Yes. |
Sample configurations
<servicenow.getAggregateRecord>
<tableName>{$ctx:tableName}</tableName>
<sysparmAvgFields>{$ctx:sysparmAvgFields}</sysparmAvgFields>
<sysparmMinFields>{$ctx:sysparmMinFields}</sysparmMinFields>
<sysparmMaxFields>{$ctx:sysparmMaxFields}</sysparmMaxFields>
<sysparmCount>{$ctx:sysparmCount}</sysparmCount>
<sysparmSumFields>{$ctx:sysparmSumFields}</sysparmSumFields>
</servicenow.getAggregateRecord>
Sample request
{
"serviceNowInstanceURL":"https://dev17686.service-now.com",
"username":"admin",
"password":"12345",
"tableName":"incident",
"sysparmAvgFields":"category,active",
"sysparmMinFields":"number",
"sysparmMaxFields":"number",
"sysparmCount":"true",
"sysparmSumFields":"priority"
}
Import Set API¶
servicenow.getRecordStagingTable
The getRecordStagingTable operation retrieves the associated record and resulting transformation result.
Parameter Name | Description | Required |
---|---|---|
tableNameStaging | Name of the staging table you want to retrieve records. | Yes. |
sysIdStaging | The Id that is automatically generated by ServiceNow. It is a unique value for each record. | Yes. |
Sample configurations
<servicenow.getRecordsStagingTable>
<tableNameStaging>{$ctx:tableNameStaging}</tableNameStaging>
<sysIdStaging>{$ctx:sysIdStaging}</sysIdStaging>
</servicenow.getRecordsStagingTable>
Sample request
{
"serviceNowInstanceURL":"https://dev17686.service-now.com",
"username":"admin",
"password":"12345",
"tableName":"incident",
"sysparmAvgFields":"category,active",
"sysparmMinFields":"number",
"sysparmMaxFields":"number",
"sysparmCount":"true",
"sysparmSumFields":"priority"
}
servicenow.postRecordStagingTable
The postRecordStagingTable operation inserts incoming data into a specified staging table and triggers transformation based on predefined transform maps in the import set table.
Parameter Name | Description | Required |
---|---|---|
tableNameStaging | Name of the staging table you want to retrieve records. | Yes. |
serialNumber | This is an attribute in the table. Specify the row value for serialNumber. | |
cpuCount | This is an attribute in the table. Specify the row value for cpuCount. | Yes. |
manufacturer | This is an attribute in the table. Specify the row value for manufacturer. | Yes. |
name | This is an attribute in the table. Specify the row value for name. | Yes. |
operatingSystem | This is an attribute in the table. Specify the row value for operatingSystem. | Yes. |
diskSpace | This is an attribute in the table. Specify the row value for diskSpace. | Yes. |
ram | This is an attribute in the table. Specify the row value for ram. | Yes. |
apiColumns | The attribute values of your table in your instance. | Yes. |
Sample configurations
<servicenow.postRecordStagingTable>
<tableNameStaging>{$ctx:tableNameStaging}</tableNameStaging>
<serialNumber>{$ctx:serialNumber}</serialNumber>
<cpuCount>{$ctx:cpuCount}</cpuCount>
<manufacturer>{$ctx:manufacturer}</manufacturer>
<name>{$ctx:name}</name>
<operatingSystem>{$ctx:operatingSystem}</operatingSystem>
<diskSpace>{$ctx:diskSpace}</diskSpace>
<ram>{$ctx:ram}</ram>
<apiColumns>{$ctx:apiColumns}</apiColumns>
</servicenow.postRecordStagingTable>
Sample request
{
"serviceNowInstanceURL":"https://dev17686.service-now.com",
"username":"admin",
"password":"12345",
"tableNameStaging":"imp_computer",
"serialNumber":"282",
"cpuCount":"234",
"name":"Mac",
"operatingSystem":"ubunthu",
"manufacturer":"IBM",
"diskSpace":"400Gb",
"ram":"ram 1500",
"apiColumns": {"sys_mod_count":"2","sys_import_state_comment":"wwww"}
}