CIUtils - 전역
CIUtils 스크립트 포함은 CI(구성 항목) 작업을 위한 유틸리티 클래스입니다.
기본적으로 CI 관계를 트래버스할 때 시스템은 최대 깊이 10을 사용합니다. glide.relationship.max_depth 속성을 수정하여 이 값을 재정의할 수 있습니다.
반환되는 최대 항목 수는 1,000개입니다. glide.relationship.threshold 속성을 수정하여 이 값을 재정의할 수 있습니다.
CIUtils 클래스는 서버 쪽 스크립트에서 사용할 수 있습니다.
CIUtils - servicesAffectedByCI(String CI_sys_id)
특정 구성 항목(CI)의 영향을 받는 비즈니스 서비스를 결정합니다.
| 이름 | 유형 | 설명 |
|---|---|---|
| CI_sys_id | 문자열 | 확인할 구성 항목(cmdb_ci)의 sys_id입니다. |
| 유형 | 설명 |
|---|---|
| 배열 | 지정된 항목의 다운스트림 또는 영향을 받는 cmdb_ci 기록에 대한 sys_id 값의 배열입니다. |
이 예에서는 CI 항목의 영향을 받는 서비스의 이름을 name = lnux100으로 표시합니다.
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 TradingCIUtils - servicesAffectedByTask(GlideRecord 작업)
지정된 작업의 영향을 받는 비즈니스 서비스를 결정합니다.
| 이름 | 유형 | 설명 |
|---|---|---|
| 작업 | GlideRecord | 작업 GlideRecord(예: 인시던트, change_request 또는 문제) |
| 유형 | 설명 |
|---|---|
| 배열 | 작업의 cmdb_ci 필드에서 참조하는 구성 항목의 다운스트림(또는 영향을 받는) CI에 대한 sys_id 값의 배열입니다. |
이 예에서는 인시던트 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