---
sourceDocument: 요코하마 ServiceNow AI 플랫폼 관리
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/ko-KR/yokohama/platform-administration

 Release :

    - yokohama

ft:locale :

    - ko-KR

ft:publication_title :

    - 요코하마 ServiceNow AI 플랫폼 관리

ft:clusterId :

    - platadm

bundleId :

    - platadm

workflow :

    - Platform


---

# 변경 이벤트 비즈니스 규칙의 샘플 스크립트

# 변경 이벤트 비즈니스 규칙의 샘플 스크립트 {#ariaid-title1}

* 릴리스 버전: Yokohama
* 
* 업데이트 날짜 2025년 01월 30일
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 소요 시간: 3분

기준선 변경 이벤트 비즈니스 규칙에는 여러 스크립트가 있습니다.
이 비즈니스 규칙은 변경 요청이 삽입되거나 업데이트된 후에 발생하는 이벤트를 정의합니다.  

    if (current.operation() == 'insert') {
     gs.eventQueue("change.inserted", current, gs.getUserID(), gs.getUserName());
    }
     
    if (current.operation() == 'update') {
     gs.eventQueue("change.updated", current, gs.getUserID(), gs.getUserName());
    }
     
    if (!current.assigned_to.nil() && current.assigned_to.changes()) {
      gs.eventQueue("change.assigned", current, current.assigned_to.getDisplayValue() , previous.assigned_to.getDisplayValue());
    }
     
    if (current.priority.changes() && current.priority == 1) {
      gs.eventQueue("change.priority.1", current, current.priority, previous.priority);
    }
     
    if (current.risk.changes() && current.risk== 1) {
      gs.eventQueue("change.risk.1", current, current.risk, previous.risk); 
    }
     
    if (current.start_date.changes() || current.end_date.changes() || current.assigned_to.changes()) {  
      if (!current.start_date.nil() && !current.end_date.nil() && !current.assigned_to.nil()) {
        gs.eventQueue("change.calendar.notify", current, current.assigned_to, previous.assigned_to);
      }
     
      // Remove from previous assigned to, due to assigned_to changing
      if (!previous.assigned_to.nil()) {
          if (!current.assigned_to.nil() && current.assigned_to.changes() && 
             (!previous.start_date.nil() && !previous.end_date.nil())) {      
            gs.eventQueue("change.calendar.notify.remove", current, current.assigned_to, previous.assigned_to);
          }
       }
      // Remove old calendar from current assigned to, due to date changing
      else if (!current.assigned_to.nil()) {
         if ((current.start_date.changes() && !previous.start_date.nil()) || 
             (current.end_date.changes() && !previous.end_date.nil())) {
           gs.eventQueue("change.calendar.notify.remove", current, current.assigned_to, current.assigned_to);
         } 
      }
    }


