Service Now勉強記録

Service Nowの勉強記録です

Service Now GlideRecord データベースの値ではなく、画面表示と同じ形式でデータを取得する getDisplayValue()

■ サンプル

var incidentGR = new GlideRecord('incident');
incidentGR.addQuery('priority', 1);
incidentGR.query();
while(incidentGR.next()){
  gs.debug(incidentGR.number + '/' + incidentGR.priority);
}

 

Service Now GlideRecored priorityは 設定値は表示される

 

 

■ getDisplayValue()を使う

var incidentGR = new GlideRecord('incident');
incidentGR.addQuery('priority', 1);
incidentGR.query();
while(incidentGR.next()){
  gs.debug(incidentGR.number + '/' + incidentGR.priority.getDisplayValue());
}

 

1ではなく、 1 - Critical が表示されるようなった