---
sourceDocument: オーストラリア API リファレンス
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/ja-JP/api-reference

 Release :

    - australia

ft:locale :

    - ja-JP

ft:publication_title :

    - オーストラリア API リファレンス

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# CIUtils - グローバル

# CIUtils - グローバル {#ariaid-title1}

* リリースバージョン: Australia
* 
* 更新日 2026年03月12日
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 所要時間：3分

CIUtils スクリプトインクルードは、構成アイテム (CI) を操作するためのメソッドを提供するユーティリティクラスです。

デフォルトでは、CI 関係をトラバースするときに最大深度 10 が使用されます。この値は、 glide.relationship.max_depth プロパティを変更することで上書きできます。

返されるアイテムの最大数は 1000 です。この値は、 glide.relationship.threshold プロパティを変更することで上書きできます。

CIUtils クラスはサーバーサイドスクリプトで使用できます。

## CIUtils - servicesAffectedByCI(文字列 CI_sys_id) {#ariaid-title2}

特定の構成アイテム (CI) の影響を受けるビジネスサービスを決定します。
{#r_CIUtils-servicesAffectedByCI_S__table_ity_vh1_4t__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| CI_sys_id | 文字列 | チェックする構成アイテム (cmdb_ci) のsys_id。 |
[表 : 1. パラメーター]

{#r_CIUtils-servicesAffectedByCI_S__table_ity_vh1_4t} {#r_CIUtils-servicesAffectedByCI_S__table_jty_vh1_4t__entry__2}

| タイプ | 説明 |
|-|-|
| アレイ | 指定されたアイテムの下流にある (またはアイテムによって影響を受ける) cmdb_ciレコードのsys_id値のアレイ。 |
[表 : 2. 返される内容]

{#r_CIUtils-servicesAffectedByCI_S__table_jty_vh1_4t}  
この例では、名前 = lnux100 の CI アイテムの影響を受けるサービスの名前を表示します。

    var CIUtil = new CIUtils();
     
    //get a server record
    var server = new GlideRecord("cmdb_ci_server");
    server.addQuery("name", "lnux100");
    server.query();
    if (server.next()) {
      //get the affected services, array of ids
      var serviceIds = CIUtil.servicesAffectedByCI(server.getUniqueValue());
      for (var i=0; i < serviceIds.length; i++) {
        //get the service record
        var service = new GlideRecord("cmdb_ci_service");
        service.get(serviceIds[i]);
        gs.print(service.getDisplayValue());
      }
    }

出力：

    Client Services
    IT Services
    Bond Trading

## CIUtils - servicesAffectedByTask (GlideRecord タスク) {#ariaid-title3}

指定されたタスクの影響を受けるビジネスサービスを判別します。
{#r_CIUtils-servicesAffByTask_GR__table_dml_r31_4t__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| タスク | GlideRecord | タスク GlideRecord (インシデント、change_request、問題など)。 |
[表 : 3. パラメーター]

{#r_CIUtils-servicesAffByTask_GR__table_dml_r31_4t} {#r_CIUtils-servicesAffByTask_GR__table_eml_r31_4t__entry__2}

| タイプ | 説明 |
|-|-|
| アレイ | タスクのcmdb_ciフィールドによって参照される構成アイテムの下流の CI の sys_id 値のリスト。 |
[表 : 4. 返される内容]

{#r_CIUtils-servicesAffByTask_GR__table_eml_r31_4t}  
この例では、インシデントINC00050の影響を受けるサービスの名前を表示します。

    var CIUtil = new CIUtils();
     
    //get an incident record
    var inc = new GlideRecord("incident");
    inc.addQuery("number", "INC00050");
    inc.query();
    if (inc.next()) {
      //get the affected services, array of ids
      var serviceIds = CIUtil.servicesAffectedByTask(inc);
      for (var i=0; i < serviceIds.length; i++) {
        //get the service record
        var service = new GlideRecord("cmdb_ci_service");
        service.get(serviceIds[i]);
        gs.print(service.getDisplayValue());
      }
    }

出力：

    IT Services
    Email
    Windows Mobile
    Electronic Messaging
    Outlook Web Access (OWA)
    Blackberry


