Let Oomnitza be your single source of truth!
You'll get complete visibility of your assets as data from ServiceNow is automatically transformed into consumable information and actionable insights.
Connect Oomnitza and ServiceNow in minutes
You'll get visibility of your ServiceNow assets by creating configurable workflows to automate tasks such as:
- Workflows for getting, updating, and inserting asset information in ServiceNow
Let Oomnitza be your single source of truth!
You'll get visibility of your devices as data from ServiceNow is automatically transformed into consumable information and actionable insights.
ServiceNow custom hardware attributes
ServiceNow search asset by serial number
ServiceNow CMDB API - Create Resource
ServiceNow CMDB API - Get Asset Details
ServiceNow CMDB API - Get Resource
ServiceNow CMDB API - Update Resource
Before you start
Before you can create the integration with Oomnitza, you need to have added your ServiceNow OAuth credentials to Oomnitza and set your ServiceNow subdomain as a global variable. For further information, refer to Adding your ServiceNow credentials to Oomnitza.
We recommend that you also create the extended integration for ServiceNow assets. You can use the information retrieved in these integrations to trigger workflows that can get and update ServiceNow information.
Creating workflows
Create asset workflows
To create an asset workflow, you must complete these steps:
- Click Configuration > Workflows
- Click Add (+) and select Assets from the list.
- Drag and drop the API block onto the Sandbox.
- Click Edit on the API block and enter ServiceNow in the search field.
- Select a preset:
- ServiceNow custom hardware attributes
- ServiceNow search asset by serial number
- ServiceNow table API - post
- ServiceNow table API - patch
- ServiceNow CMDB computer
- ServiceNow CMDB API - Create Resource
- ServiceNow CMDB API - Get Resource
- ServiceNow CMDB API - Get Asset Details
- ServiceNow CMDB API - Update Resource
- To choose a preset, click the forward arrow (>).
- Select the credentials that you created in Adding your ServiceNow credentials to Oomnitza.
- Your Subdomain should be derived from the variable created in Setting your ServiceNow Subdomain as a global variable or entered manually.
- Configure the API Block following the preset instructions below, and save your changes.
- Edit the Begin Block and add rules to trigger the workflow. For example, if you set the Actions to New you can trigger a workflow every time a new asset is created. Refer to Using the Begin block.
- Connect the Blocks.
- Save, validate, and activate your workflow.
Using the ServiceNow custom hardware attributes preset
This ServiceNow custom hardware attributes preset allows you to get asset information relating to the alm_hardware table in ServiceNow. When constructing a workflow that uses this preset, the CMDB CI ID is required. You can retrieve the CMDB CI ID of an asset by running the ServiceNow Asset Load. Then, you can call the value in the workflow by entering: {{servicenow_cmdb_ci_id}}.
For additional information about the ServiceNow API see ServiceNow - Table API.
Using the ServiceNow search asset by serial number preset
This ServiceNow search asset by serial number preset allows you to retrieve information from the alm_asset table in ServiceNow. When constructing a workflow that uses this preset, the Serial Number is required. You can retrieve an asset's Serial Number by running the ServiceNow Asset Load. Then, you can call the value in the workflow by entering: {{serial_number}}.
For additional information about the ServiceNow API see ServiceNow - Table API or ServiceNow - Asset Management Table List.
Using the ServiceNow table API - post preset
This ServiceNow table API - post preset allows you to create a record in a ServiceNow table. When constructing a workflow that uses this preset, the following steps are required:
- In the API block window, enter the Table Name of the record to update, i.e. cmdb_ci, cmdb_database, cmdb_ci_aix_server, alm_asset, etc.
- Click the Advanced Mode button located in the upper right of the window.
- Select the Body tab. Enter the fields that you wish to update in proper JSON format, for example:
{
"asset_tag": "{{barcode}}", "po_number": "{{po_number}}", "owned_by": "{{assigned_to}}", "cost_center": "{{department}}", "serial_number": "{{serial_number}}", "purchase_date": "{{purchase_date}}", "comments": "{{notes}}", "cost": {{purchase_price}} } - Select the curly brackets to the right of the window to update or add additional fields.
-
Select the Response tab. Map the Response field to an Oomnitza field, such as Sys ID. The below can be used in the Response field to capture the Sys ID from the newly created record:
{{response["result"]["sys_id"]["display_value"]}}For information on creating your own Jinja statement, see Importing and Using Libraries with Jinja2.
For additional information about the ServiceNow API see ServiceNow - Table API.
Using the ServiceNow table API - patch preset
This ServiceNow table API - patch preset allows you to update a record in a ServiceNow table. When constructing a workflow that uses this preset, the following information is required:
Table Name: For example, cmdb_ci, cmdb_database, cmdb_ci_aix_server, alm_asset, etc.
Sys ID: A unique identifier (sys_id) associated with a table. You can retrieve the Sys ID (Internal Sys ID) for the alm_asset table by running the ServiceNow Asset Load. You can retrieve the Sys ID (ServiceNowCMDB CI ID) for the cmdb_ci table by running the ServiceNow CMD CI Asset Load.
You can customize the API response by following the steps in Using the ServiceNow table API - post preset.
For additional information about the ServiceNow API see ServiceNow - Patch table or ServiceNow - Asset Management Table List.
Using the ServiceNow CMDB computer preset
This ServiceNow CMDB computer preset allows you to get asset information from the CMDB cmdb_ci_computer table in ServiceNow. When constructing a workflow that uses this preset, the following steps are required:
- In the API block window, enter the CMDB CI ID of the asset you want to retrieve. You can retrieve the CMDB CI ID for the alm_asset table by running the ServiceNow Asset Load. You can retrieve the CMDB CI ID for the cmdb_ci table by running the ServiceNow CMD CI Asset Load. Then, you can call the value in the workflow by entering:
{{service_now_cmdb_ci_id}}. - Click the Advanced Mode button located in the upper right of the window.
- Select the Params tab. The
{{sysparm_fields}}value displays a list of fields to be returned in the response. The{{sysparm_query}}contains the CMDB CI ID. -
Select the Response tab. Map the Response field to an Oomnitza field, such as Operating System. The below can be used in the Response field to capture the Operating System from the asset details.
{% set rr = response['result'] %}{% if rr %}{% set cc = rr[0] %}{% if cc.get('os') %}{% if cc['os'] is mapping %}{{ cc['os'].get('display_value') }}{% else %}{{ cc['os'] }}{% endif %}{% else %}{{ '' }}{% endif %}{% else %}{{ '' }}{% endif %}For information on creating your own Jinja statement, see Importing and Using Libraries with Jinja2.
For additional information about the ServiceNow API see ServiceNow - Table API.
Using the ServiceNow CMDB API - Create Resource preset
This ServiceNow CMDB API - Create Resource creates a resource in the specified Configuration Management Database (CMDB) table. When you select this preset you need to supply the Table Name. This is the name of the table where the resource will be located, such as cmdb_ci_linux_server or cmdb_ci_apache_web_server.
The following is an example of the values that can be entered in Advanced Mode>Body.
{
"attributes": {
"name": "Macbook Pro 17",
"serial_number": "ABE-486-V17263-DO",
"asset_tag": "P1000503"
},
"source": "ServiceNow"
}
The entire response can be mapped in Advanced Mode>Response.
Using the ServiceNow CMDB API - Get Resource preset
This ServiceNow CMDB API - Get Resource gets the details of a resource with its ServiceNow Resource ID (also known as sys_id) and Table Name.
You can retrieve the Resource ID (Internal Sys ID) for the alm_asset table by running the ServiceNow Asset Load. You can retrieve the Resource ID (ServiceNowCMDB CI ID) for the cmdb_ci table by running the ServiceNow CMD CI Asset Load.
The entire response can be mapped in Advanced Mode>Response similar to the ServiceNow CMDB API - Create Resource preset.
Example API Response
{
"result": {
"outbound_relations": [],
"attributes": {
"attested_date": "",
"skip_sync": "false",
"operational_status": "1",
"sys_updated_on": "2022-09-22 15:29:28",
"attestation_score": "",
"discovery_source": "ServiceNow",
"first_discovered": "2022-09-22 14:58:19",
"sys_updated_by": "admin",
"due_in": "",
"sys_created_on": "2012-02-18 08:14:21",
"sys_domain": {
"display_value": "global",
"link": "https://demo.service-now.com/api/now/table/sys_user_group/global",
"value": "global"
},
"install_date": "2019-05-17 07:00:00",
"invoice_number": "",
"gl_account": "",
"sys_created_by": "admin",
"warranty_expiration": "2022-05-16",
"asset_tag": "P1000503",
"fqdn": "",
"change_control": "",
"owned_by": "",
"checked_out": "",
"sys_domain_path": "/",
"business_unit": "",
"delivery_date": "2019-03-29 08:00:00",
"maintenance_schedule": "",
"install_status": "1",
"cost_center": {
"display_value": "IT",
"link": "https:.....",
"value": "d9d0a971c0a80a641c20b13d99a48576"
},
"attested_by": "",
"supported_by": "",
"dns_domain": "",
"name": "test1234",
"assigned": "2019-08-30 07:00:00",
"purchase_date": "2019-03-14",
"life_cycle_stage": "",
"subcategory": "Computer",
"short_description": "",
"assignment_group": "",
"managed_by": "",
"managed_by_group": "",
"last_discovered": "2022-09-22 15:29:28",
"can_print": "false",
"sys_class_name": "cmdb_ci_computer",
"manufacturer": {
"display_value": "Apple",
"link": "https://demo.service-now.com.....",
"value": "b7e9e843c0a80169009a5a485bb2a2b5"
},
"sys_id": "00a96c0d3790200044e0bfc8bcbe5db4",
"po_number": "PO100003",
"checked_in": "",
"sys_class_path": "/!!/!2/!(",
"vendor": {
"display_value": "Apple",
"link": "https://demo.service-now.com...",
"value": "b7e9e843c0a80169009a5a485bb2a2b5"
},
"life_cycle_stage_status": "",
"mac_address": "",
"company": {
"display_value": "ACME France",
"link": "https://demo.service-now.com....d",
"value": "81fbfe03ac1d55eb286d832de58ae1fd"
},
"model_number": "",
"justification": "",
"department": {
"display_value": "IT",
"link": "https://demo.service-now.com....",
"value": "221f79b7c6112284005d646b76ab978c"
},
"assigned_to": {
"display_value": "Eduardo Bellendir",
"link": "https://dev130537.service-now.com....",
"value": "92826bf03710200044e0bfc8bcbe5dbb"
},
"start_date": "",
"cost": "1799.99",
"comments": "",
"sys_mod_count": "8",
"serial_number": "ABE-486-V17263-DO",
"monitor": "false",
"model_id": {
"display_value": "Apple MacBook Pro 15\"",
"link": "https://demo.service-now.com....",
"value": "d501454f1b1310002502fbcd2c071334"
},
"ip_address": "",
"duplicate_of": "",
"sys_tags": "",
"cost_cc": "USD",
"support_group": "",
"order_date": "2019-03-02 08:00:00",
"schedule": "",
"environment": "",
"due": "",
"attested": "false",
"unverified": "false",
"correlation_id": "",
"attributes": "",
"location": {
"display_value": "27, Boulevard Vitton, Paris",
"link": "https://demo.service-now.com....",
"value": "8226baa4ac1d55eb40eb653c02649519"
},
"asset": {
"display_value": "P1000503 - Apple MacBook Pro 15\"",
"link": "https://demo.service-now.com...",
"value": "04a96c0d3790200044e0bfc8bcbe5db3"
},
"category": "Hardware",
"fault_count": "0",
"lease_id": ""
},
"inbound_relations": []
}
}
Using the ServiceNow CMDB API - Get Asset Details preset
This ServiceNow CMDB API - Get Asset Details gets the details of a resource with its ServiceNow Resource ID (also known as sys_id). This preset is identical to the Get Resource preset, except for this preset the Table Name is fixed to return information from the cmdb_ci table only.
Using the ServiceNow CMDB API - Update Resource preset
This ServiceNow CMDB API - Update Resource updates a resource in the CMDB table.
The following is an example of the values that can be entered in Advanced Mode>Body.
Example Message Body
{
"attributes": {
"name": "Macbook Pro 17"
},
"source": "ServiceNow"
}
The entire response can be mapped in Advanced Mode>Response similar to the ServiceNow CMDB API - Create Resource preset.
Comments
0 comments
Please sign in to leave a comment.