새 문제 티켓 이벤트에 대한 비즈니스 규칙 추가
구현에 새 문제 티켓 이벤트를 추가할 때 인스턴스에 비즈니스 규칙을 추가해야 합니다 ServiceNow .
이 비즈니스 규칙은 해당 인시던트 또는 케이스 기록의 Glide 스냅샷을 생산자 알림 프레임워크 인바운드 큐, 인바운드 큐[sn_tmt_core_inbound_queue] 테이블로 푸시해야 하며, 이때 생산자 알림 프레임워크에서 처리 및 게시됩니다.
다음 코드 스니펫은 인시던트 [incident] 테이블에서 ResolveTroubleTicketEventForIncident 티켓 알림 이벤트를 처리하기 위한 비즈니스 규칙의 예를 보여줍니다. pushEventsToQueue() 메서드를 호출하여 이벤트를 인바운드 큐로 푸시할 때는 이벤트 유형을 전달해야 합니다. 이 예제에서는 ResolveTroubleTicketEventForIncident입니다. 이 이벤트 유형은 원하는 영숫자 값일 수 있지만, 시스템에서 문제 티켓 이벤트를 처리하는 방법을 결정하는 데 사용되므로 고유해야 합니다. 기본 시스템의 Constants.EVENT_TYPES 이벤트 유형 목록은 상수 [sn_api_notif_mgmt. 상수] 스크립트 포함.
비즈니스 규칙 생성에 대한 자세한 내용은 을 참조하십시오 Create a business rule for your service.
// Add following lines of code in script section (Advanced tab) of BR for pushing ‘ResolveTroubleTicketEventForIncident’ to the inbound queue.
(function executeRule(current, previous /*null when async*/ ) {
// Note that event needs to be passed at BR level itself as after this step, we would be left with glide snapshot only
new TroubleTicketNotificationUtil().pushEventsToQueue(current,'ResolveTroubleTicketEventForIncident', Constants.TROUBLE_TICKET_TYPE.INCIDENT);
})(current, previous)