ディスカバリー:CI の [場所] フィールドの設定方法 |CI の [場所] フィールドが空なのはなぜですか? |CI の場所の設定方法Summary<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: block; max-width: ; width: auto; height: auto; } } 現在の実装では、2 つの方法を使用して CI の場所の詳細を設定します。 1.CI にアサイニー (assigned_toフィールド) がある場合、ディスカバリーは更新後にユーザーの [場所] フィールドから場所を調達できます。 たとえば、場所 = 「インド」のユーザー「test」が CI の assigned_to として設定されている場合、CI の場所はインドに設定されます。 動作を担当するビジネスルールスクリプト: if(!current.assigned_to.location.nil()) { current.location = current.assigned_to.location;} 以下は、ビジネスルールを確認するためのリンクです https://<YOUR_INSTANCE_NAME>.service-now.com/sys_script_list.do?sysparm_query=nameSTARTSWITHUpdate%20location%20as%20needed%5Ecollection%3Dcmdb_ci&sysparm_view= 2.ディスカバリースケジュールを使用して CI を検出する場合、ディスカバリーはディスカバリースケジュールに設定された場所から CI の [場所] フィールドを設定します。[場所] フィールドがビューに表示されていない場合は、フォームに追加します。 動作の原因となるセンサースクリプト: * 現在のディスカバリーの場所を取得します。 * @returns文字列|null 現在のセンサーの場所の SysID。見つからない場合は NULL です。 */ getLocationID: function() {if (typeof(this._locationID) !== 'undefined') // initialized on demand by this method.return this._locationID;this._locationID = null; // initializevar scheduleGr = new GlideRecord('discovery_schedule');if (!scheduleGr.get(g_status.scheduleID))return null;if (!scheduleGr.location)return null;this._locationID = ''+scheduleGr.location.sys_id;return this._locationID; 以下は、上記の動作の原因となるセンサースクリプトにアクセスするための URL です https://<YOUR_INSTANCE_NAME>.service-now.com/nav_to.do?uri=%2Fsys_script_include.do%3Fsys_id%3D778011130a0a0b2500c4595ad1d1d768 場所がメソッド #1 で設定されている場合、メソッド #2 では上書きされず、その逆も同様です。 注意:初期設定の機能を使用して検出しても、正確な CI の場所を取得することはできません。 Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: block; max-width: ; width: auto; height: auto; } } すべての