# ServiceNow - Asset management connector thinklet

Configure ServiceNow - Incident management connector thinklets to take specific actions within your workflow.

## Action: Get user details by email address <a href="#servicenow-assetmanagement-action-getuserdetailsbyemailaddress" id="servicenow-assetmanagement-action-getuserdetailsbyemailaddress"></a>

**Get user details by email address** retrieves detailed user data.

The ServiceNow - Asset management connector thinklet relies on the [Table sys\_user GET](https://www.servicenow.com/docs/bundle/washingtondc-api-reference/page/integrate/inbound-rest/concept/c_TableAPI.html#title_table-GET) API endpoint.

<figure><img src="https://268444917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJSUDk9NTtCHYPG5EWs3%2Fuploads%2Fgit-blob-5a134de4a9aaee1f8abd76c2ddc6e5f6d7c2ba29%2Fimage-20240604-123140.png?alt=media" alt="image-20240604-123140.png" width="589"><figcaption></figcaption></figure>

* **Parameters:** Configure the data used as parameters for this action. Hover over the tooltip icon for more information on how the parameter is mapped and what data is required.
  * **User email address**
* **Outputs:** View the outputs of the connector thinklet.
  * **User ID** (`UserID`)
  * **User name** (`UserName`): ServiceNow username
  * **Enable MFA** (`EnableMultifactorAauthn`): Enable multifactor authentication
  * **VIP** (`VIPUser`)
  * **Password needs reset** (`PasswordNeedsReset`)

The table below shows the API Service connector details needed when recreating the connector:

<table><thead><tr><th width="272">Field</th><th>Value</th><th data-hidden></th></tr></thead><tbody><tr><td>Resource Path</td><td><code>/api/now/table/sys_user?sysparm_query=email={{UserEmailAddress}}</code></td><td></td></tr><tr><td>Method</td><td>GET</td><td></td></tr><tr><td>Payload</td><td></td><td></td></tr><tr><td>Outputs</td><td><p><code>EnableMultifactorAauthn $.result[0].enable_multifactor_authn</code></p><p><code>PasswordNeedsReset $.result[0].password_needs_reset UserID $.result[0].sys_id</code></p><p><code>UserName $.result[0].user_name</code></p><p><code>VIPUser $.result[0].vip</code></p></td><td></td></tr></tbody></table>

## Action: Get user details by user ID <a href="#servicenow-assetmanagement-action-getuserdetailsbyuserid" id="servicenow-assetmanagement-action-getuserdetailsbyuserid"></a>

**Get user details by user ID** retrieves detailed user data.

The ServiceNow - Asset management connector thinklet relies on the [Table sys\_user GET](https://www.servicenow.com/docs/bundle/washingtondc-api-reference/page/integrate/inbound-rest/concept/c_TableAPI.html#title_table-GET) API endpoint.

Below is an example of the thinklet setup:

<figure><img src="https://268444917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJSUDk9NTtCHYPG5EWs3%2Fuploads%2Fgit-blob-f7dff868c3b401e44ce505cfa255b4c02d640185%2Fimage-20240604-123942.png?alt=media" alt="image-20240604-123942.png" width="580"><figcaption></figcaption></figure>

* **Parameters:** Configure the data used as parameters for this action. Hover over the tooltip icon for more information on how the parameter is mapped and what data is required.
  * **ServiceNow user ID**
* **Outputs:** View the outputs of the Connector thinklet.
  * **User email address** (`UserEmailAddress`)
  * **User name** (`UserName`): ServiceNow username
  * **Enable MFA** (`EnableMultifactorAauthn`): Enable multifactor authentication
  * **VIP** (`VIPUser`)
  * **Password needs reset** (`PasswordNeedsReset`)

The table below shows the API Service connector details needed when recreating the connector:

<table><thead><tr><th width="272">Field</th><th>Value</th><th data-hidden></th></tr></thead><tbody><tr><td>Resource Path</td><td><code>/api/now/table/sys_user/{{ServiceNowUserID}}</code></td><td></td></tr><tr><td>Method</td><td>GET</td><td></td></tr><tr><td>Payload</td><td></td><td></td></tr><tr><td>Outputs</td><td><p><code>UserEmailAddress $.result.email</code></p><p><code>EnableMultifactorAauthn $.result.enable_multifactor_authn PasswordNeedsReset $.result.password_needs_reset UserName $.result.user_name</code></p><p><code>VIPUser $.result.vip</code></p></td><td></td></tr></tbody></table>

## Action: Get device details by device name <a href="#servicenow-assetmanagement-action-getdevicedetailsbydevicename" id="servicenow-assetmanagement-action-getdevicedetailsbydevicename"></a>

**Get device details by device name** retrieves detailed device data.

The ServiceNow - Asset management connector thinklet relies on the [Table cmdb\_ci\_computer GET](https://www.servicenow.com/docs/bundle/washingtondc-api-reference/page/integrate/inbound-rest/concept/c_TableAPI.html#title_table-GET) API endpoint.

<figure><img src="https://268444917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJSUDk9NTtCHYPG5EWs3%2Fuploads%2Fgit-blob-58be1ab2da9f1ba56be7d18f0595398d548a4669%2Fimage-20240604-130939.png?alt=media" alt="image-20240604-130939.png" width="583"><figcaption></figcaption></figure>

* **Parameters:** Configure the data used as parameters for this action. Hover over the tooltip icon for more information on how the parameter is mapped and what data is required.
  * **Device ID**
* **Outputs:** View the outputs of the connector thinklet.
  * **Computer ID** (`ComputerID`): ServiceNow computer ID
  * **Purchase date** (`PurchaseDate`)
  * **Warranty expiration date** (`WarrantyExpirationDate`)
  * **Owned by ID** (`OwnedByID`)
  * **Assigned to ID** (`AssignedToID`)
  * **Managed by ID** (`ManagedByID`)
  * **Asset ID** (`AssetID`)
  * **Life cycle stage** (`LifeCycleStage`): *Defective*, *Deploy*, *End of Life*, *Inventory*, *Missing*, *Operational*, *Purchase*

The table below shows the API Service connector details needed when recreating the connector:

<table><thead><tr><th width="272">Field</th><th>Value</th><th data-hidden></th></tr></thead><tbody><tr><td>Resource Path</td><td><code>/api/now/table/cmdb_ci_computer?sysparm_query=name={{DeviceName}}</code></td><td></td></tr><tr><td>Method</td><td>GET</td><td></td></tr><tr><td>Payload</td><td></td><td></td></tr><tr><td>Outputs</td><td><p><code>AssetID $.result[0].asset.value</code></p><p><code>AssignedToID $.result[0].assigned_to.value</code></p><p><code>LifeCycleStage $.result[0].life_cycle_stage.value ManagedByID $.result[0].managed_by.value</code></p><p><code>OwnedByID $.result[0].owned_by.value</code></p><p><code>PurchaseDate $.result[0].purchase_date</code></p><p><code>ComputerID $.result[0].sys_id</code></p><p><code>WarrantyExpirationDate $.result[0].warranty_expiration</code></p></td><td></td></tr></tbody></table>

## Action: Get device details by device ID <a href="#servicenow-assetmanagement-action-getdevicedetailsbydeviceid" id="servicenow-assetmanagement-action-getdevicedetailsbydeviceid"></a>

**Get device details by device ID** retrieves detailed device data.

The ServiceNow - Asset management connector thinklet relies on the [Table cmdb\_ci\_computer GET](https://www.servicenow.com/docs/bundle/washingtondc-api-reference/page/integrate/inbound-rest/concept/c_TableAPI.html#title_table-GET) API endpoint.

<figure><img src="https://268444917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJSUDk9NTtCHYPG5EWs3%2Fuploads%2Fgit-blob-987b912f0a7715178b88ba79dde4c16ff60d0fd3%2Fimage-20240604-131025.png?alt=media" alt="image-20240604-131025.png" width="593"><figcaption></figcaption></figure>

* **Parameters:** Configure the data used as parameters for this action. Hover over the tooltip icon for more information on how the parameter is mapped and what data is required.
  * **Device ID**
* **Outputs:** View the outputs of the Connector thinklet.
  * **Computer name** (`ComputerName`): ServiceNow computer name
  * **Purchase date** (`PurchaseDate`)
  * **Warranty expiration date** (`WarrantyExpirationDate`)
  * **Owned by ID** (`OwnedByID`)
  * **Assigned to ID** (`AssignedToID`)
  * **Managed by ID** (`ManagedByID`)
  * **Asset ID** (`AssetID`)
  * **Life cycle stage** (`LifeCycleStage`): *Defective*, *Deploy*, *End of Life*, *Inventory*, *Missing*, *Operational*, *Purchase*

The table below shows the API Service connector details needed when recreating the connector:

<table><thead><tr><th width="272">Field</th><th>Value</th><th data-hidden></th></tr></thead><tbody><tr><td>Resource Path</td><td><code>/api/now/table/cmdb_ci_computer/{{DeviceID}}</code></td><td></td></tr><tr><td>Method</td><td>GET</td><td></td></tr><tr><td>Payload</td><td></td><td></td></tr><tr><td>Outputs</td><td><p><code>AssetID $.result.asset.value</code></p><p><code>AssignedToID $.result.assigned_to.value</code></p><p><code>LifeCycleStage $.result.life_cycle_stage.value</code></p><p><code>ManagedByID $.result.managed_by.value</code></p><p><code>ComputerName $.result.name</code></p><p><code>OwnedByID $.result.owned_by.value</code></p><p><code>PurchaseDate $.result.purchase_date WarrantyExpirationDate $.result.warranty_expiration</code></p></td><td></td></tr></tbody></table>

## Action: Get hardware asset details by CI ID <a href="#action-get-hardware-asset-details-by-ci-id" id="action-get-hardware-asset-details-by-ci-id"></a>

**Get hardware asset details by CI ID** retrieves detailed hardware asset data. This data can be integrated into a workflow to, for instance, verify the status of an asset and initiate actions exclusively for those in an *In use* state.

The ServiceNow - Asset management connector thinklet relies on the [Table alm\_hardware GET](https://www.servicenow.com/docs/bundle/washingtondc-api-reference/page/integrate/inbound-rest/concept/c_TableAPI.html#title_table-GET) API endpoint.

Below is an example of the thinklet setup:

<figure><img src="https://268444917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJSUDk9NTtCHYPG5EWs3%2Fuploads%2Fgit-blob-cf8dbeeb8437dcfa7550c2e9c31eb68f4aa530a9%2Fimage-20240618-141615.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

* **Parameters**
  * **Configuration Item ID (**`ConfigurationItemID`**)**
* **Outputs**
  * **State** (`State`) - Hardware asset state— 1- *In use*, 2- *On order*, 3- *In maintenance*, 6- *In stock*, 7- *Retired*, 8- *Missing*, 9- *In transit*, 11- *Build*
  * **Substate** (`Substate`) - Current substate of the asset dependent on **State**
  * **Display name** (`DisplayName`)
  * **Hardware asset ID** (`HardwareAssetID`)
  * **Serial number** (`SerialNumber`)

The table below shows the API Service connector details needed when recreating the connector:

<table><thead><tr><th width="272">Field</th><th>Value</th><th data-hidden></th></tr></thead><tbody><tr><td>Resource Path</td><td><code>api/now/table/alm_hardware?sysparm_query=ci.value={{ConfigurationItemID}}&#x26;sysparm_limit=1</code></td><td></td></tr><tr><td>Method</td><td>GET</td><td></td></tr><tr><td>Payload</td><td></td><td></td></tr><tr><td>Outputs</td><td><p><code>AssetTag $.result[0].asset_tag</code></p><p><code>DisplayName $.result[0].display_name</code></p><p><code>State $.result[0].install_status</code></p><p><code>SerialNumber $.result[0].serial_number</code></p><p><code>Substate $.result[0].substatus</code></p><p><code>HardwareAssetID $.result[0].sys_id</code></p></td><td></td></tr></tbody></table>

## Action: Set device life cycle stage and status <a href="#action-get-hardware-asset-details-by-ci-id" id="action-get-hardware-asset-details-by-ci-id"></a>

**Set device life cycle stage and status** action updates the life cycle stage and status of a CI (Configuration Item) computer. The standard values for life cycle stages are "Defective," "Deploy," "End of Life," "Inventory," "Missing," "Operational," and "Purchase." Each life cycle stage has corresponding allowed status values, such as "In Maintenance" or "In Use." This action should be used according to the locally defined configuration for these fields.

The ServiceNow - Asset management connector thinklet relies on the [Table cmdb\_ci\_computer PUT](https://www.servicenow.com/docs/bundle/washingtondc-api-reference/page/integrate/inbound-rest/concept/c_TableAPI.html#title_table-PUT) API endpoint.

Below is an example of the thinklet setup:

<figure><img src="https://268444917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJSUDk9NTtCHYPG5EWs3%2Fuploads%2Fgit-blob-f581ec9b3514635b14ee7e9384acd453baac54b5%2Fimage%20(242).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

* **Parameters**
  * **Computer ID (**&#x43;omputerI&#x44;**)**
  * **Life cycle stage (**&#x4C;ifeCycleStag&#x65;**)**
  * **Life cycle stage status (**&#x4C;ifeCycleStageStatu&#x73;**)**
* **Outputs**
  * **Computer ID** (ComputerID) - ServiceNow computer ID

The table below shows the API Service connector details needed when recreating the connector:

<table><thead><tr><th width="272">Field</th><th>Value</th><th data-hidden></th></tr></thead><tbody><tr><td>Resource Path</td><td><code>api/now/table/cmdb_ci_computer/{{ComputerID}}</code></td><td></td></tr><tr><td>Method</td><td>GET</td><td></td></tr><tr><td>Payload</td><td><code>{"life_cycle_stage": "{{LifeCycleStage}}", "life_cycle_stage_status": "{{LifeCycleStageStatus}}"}</code></td><td></td></tr><tr><td>Outputs</td><td><code>ComputerID $.result[0].sys_id</code></td><td></td></tr></tbody></table>

{% hint style="info" %}
Refer to the [Configuring connector thinklets](https://docs.nexthink.com/platform/user-guide/workflows/creating-workflows/configuring-connector-thinklet) documentation for more information about connector thinklets.
{% endhint %}
