LoginSignup
2
3

More than 3 years have passed since last update.

ServiceNow - システムプロパティを利用する

Posted at

ServiceNowのシステムプロパティの使い方

ServiceNowインスタンス共有のプロパティを定義することができる。
定義したプロパティをスクリプトから参照することが可能。

例:

var sys_prop = gs.getProperty('system.properties.name');

プロパティを定義する

1.アプリケーションナビゲータから「sys_properties.list」を検索。システムプロパティ一覧が表示される。
system_properties_1.png
2.「新規」ボタンを押下
system_properties_2.png
3.「名前」にプロパティ名、値にプロパティの値を入力した後に「送信」ボタンを押下。これでプロパティはServiceNowインスタンスで定義される。
system_properties_3.png

プロパティの利用

プロパティはサーバ側スクリプトで利用可能
例:
「スクリプト-バックグラウンド」を開き、次のスクリプトを実行

var ip_address = gs.getProperty('ozawa.internal.service.ip');
gs.info("ip:" + ip_address);

system_properties_4.png
実行結果:
system_properties_5.png

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3