---
sourceDocument: Yokohama IT Asset Management
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/ja-JP/yokohama/it-asset-management

 Release :

    - yokohama

ft:locale :

    - ja-JP

ft:publication_title :

    - Yokohama IT Asset Management

ft:clusterId :

    - itam

bundleId :

    - itam

workflow :

    - Technology


---

# カスタム ライセンスのメトリクスのスクリプト例

# カスタム ライセンスのメトリクスのスクリプト例 {#ariaid-title1}

* リリースバージョン: Yokohama
* 
* 更新日 2025年01月30日
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 所要時間：1分

カスタムライセンスのメトリクススクリプトの例を次に示します。
注:  
この例はデモのみを目的としており、実際のコンプライアンスシナリオでの使用を意図したものではありません。

    <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>


