Custom license metric example script
reference brazil Updated Sep 10, 2026 1 min read custom-license-example-script.md
The following is an example of a custom license metric script.
Note: This example is for demo purposes only and is not meant to be used for actual compliance scenarios.
XML
<script><![CDATA[getRightsForDevice();function getRightsForDevice(){var rightsForDevice = -1; var deviceRecord = new GlideRecord('cmdb_ci_computer'); if(deviceRecord.get(entity)){ rightsForDevice = deviceRecord.getValue('disk_space'); } return rightsForDevice;}]]></script>Parent Topic:Add a custom license metric
35 lines · 1.3 KB
---
title: Custom license metric example script
description: The following is an example of a custom license metric script.
locale: en-US
canonical_url: https://www.servicenow.com/docs/r/it-asset-management/software-asset-management/custom-license-example-script.html
release: brazil
product: Software Asset Management
classification: software-asset-management
topic_type: reference
last_updated: "2026-09-10"
reading_time_minutes: 1
breadcrumb: [Add a custom license metric, Software Asset Management administration, Software Asset Management, IT Asset Management, Asset Management]
---
# Custom license metric example script
The following is an example of a custom license metric script.
**Note:** This example is for demo purposes only and is not meant to be used for actual compliance scenarios.
```
<script><![CDATA[getRightsForDevice();
function getRightsForDevice(){
var rightsForDevice = -1;
var deviceRecord = new GlideRecord('cmdb_ci_computer');
if(deviceRecord.get(entity)){
rightsForDevice = deviceRecord.getValue('disk_space');
}
return rightsForDevice;
}]]></script>
```
**Parent Topic:**[Add a custom license metric](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/it-asset-management/software-asset-management/add-custom-license-metric.md)
| title | Custom license metric example script |
| description | The following is an example of a custom license metric script. |
| locale | en-US |
| canonical_url | https://www.servicenow.com/docs/r/it-asset-management/software-asset-management/custom-license-example-script.html |
| release | brazil |
| product | Software Asset Management |
| classification | software-asset-management |
| topic_type | reference |
| last_updated | 2026-09-10 |
| reading_time_minutes | 1 |
| breadcrumb | Add a custom license metricSoftware Asset Management administrationSoftware Asset ManagementIT Asset ManagementAsset Management |