인스턴스 사용자 스토리 통합 구성

  • 릴리스 버전: Australia
  • 업데이트 날짜 2026년 03월 12일
  • 소요 시간: 5분
  • 프로덕션 인스턴스의 스토리를 사용하여 비프로덕션 환경에서 결과를 공식적으로 추적합니다. ServiceNow 인스턴스 사용자 스토리 통합을 구성하려면 다음 절차를 수행합니다.

    시작하기 전에

    필요한 역할: 스캔 엔진 관리자(sn_se.scan_engine_admin)

    프로시저

    1. 인스턴스를 등록합니다.
      인스턴스 등록 문서를 참조하십시오.
    2. 사용자 스토리 테이블을 설정합니다.
      선택한 테이블이 기록을 삽입하려는 대상 테이블이 됩니다. rm_story와 같은 작업 기반 테이블이 일반적으로 선택됩니다. 이 테이블은 소스 인스턴스와 대상 인스턴스 모두에 있어야 합니다.
    3. 선택한 사용자 스토리 테이블 을 기반으로 필드 업데이트를 동적으로 처리하도록 연결된 스크립트를 사용자 지정하고 사용자 스토리 필드 매핑 및 사용 가능한 필드를 정의합니다.

      이를 통해 스크립팅을 사용하여 하위 환경의 찾기에서 상위 환경의 스토리로의 매핑을 정의할 수 있습니다. 예를 들어, 선택한 테이블에서 사용할 수 있는 간단한 설명, 설명 또는 기타 필드를 채우는 값을 지정할 수 있습니다.

      기본적으로 가이드로 사용할 수 있는 샘플과 함께 유용한 정보가 설명에 제공됩니다. 필요에 맞게 스크립트를 구성합니다.

      소스 및 대상 인스턴스 처리 스크립트를 구성할 때 다음 변수를 사용할 수 있습니다.

      isSource
      소스 인스턴스(dev)에서 실행할 때 true 로 설정합니다.
      isDestination
      대상 인스턴스(prod)에서 실행할 때 true 로 설정합니다.
      페이로드
      인스턴스 간에 정보를 전달하는 데 사용되는 사용자 정의 변수입니다.
      gr찾기
      요청을 보내는 결과의 GlideRecord입니다. 소스 인스턴스에만 정의됩니다. 사용 가능한 필드는 sn_se_finding 테이블의 필드입니다.
      gr작업
      대상 인스턴스에서 생성되는 GlideRecord 대상 인스턴스에만 정의됩니다. 사용 가능한 필드는 사용자 스토리 테이블 열에서 선택한 테이블의 필드입니다.

      isSource일 경우 스크립트는 소스 인스턴스에서만 실행됩니다. 이 블록을 사용하여 결과 기록의 변수로 페이로드 객체를 로드합니다. 사용 가능한 필드는 sn_se_finding 테이블 내의 필드입니다.

      if (isSource) {
            // This logic is ONLY executed on the SOURCE instance.
            // Load the 'payload' object with variables from the finding record.
            // The fields which can be used are fields within the sn_se_finding table.
      
            payload.short_description = "Story generated from finding - " + grFinding.getDisplayValue();
            payload.description = "Definition: " + grFinding.definition.short_description;
            payload.description += "\nFinding details: " + grFinding.getValue('finding_details');
            payload.description += "\nFinding URL: " + gs.getProperty("glide.servlet.uri") + grFinding.getLink(false);
      }

      isDestination일 경우 스크립트는 대상 인스턴스에서만 실행됩니다. 이 블록을 사용하여 스토리 또는 작업 테이블의 필드에 페이로드 객체 값을 적용합니다. 기록이 생성되도록 grTask.insert() 가 호출되었는지 확인합니다. rm_story 선택한 경우 사용 가능한 필드는 rm_story 테이블의 필드입니다.

      if (isDestination) {
            // This logic is ONLY executed on the TARGET instance.
            // Set the field values in the Story/Task table using the payload object.
            // The fields which can be used are fields within the Story table.
            // If you selected rm_story, the fields you can set are those of the rm_story table.
      
            grTask.short_description = payload.short_description;
            grTask.description = payload.description;
            grTask.insert();
      }

      다음은 소스 및 대상 처리를 모두 보여주는 완전한 예입니다.

      // Available variables
      // isSource      - True when on source instance (dev)
      // isDestination - True when on destination instance (prod)
      // payload       - The user-defined variable used to pass information between instances
      // grFinding     - The GlideRecord of the finding sending the request (source only)
      // grTask        - The GlideRecord being created on the destination instance (destination only)
      
      // Source processing and payload preparation
      if (isSource) {
            payload.short_description = "Story generated from finding - " + grFinding.getDisplayValue();
            payload.description = "Definition: " + grFinding.definition.short_description;
            payload.description += "\nFinding details: " + grFinding.getValue('finding_details');
            payload.description += "\nFinding URL: " + gs.getProperty("glide.servlet.uri") + grFinding.getLink(false);
      }
      
      // Destination processing and payload use
      // Make sure to include grTask.insert() so that the record is created
      if (isDestination) {
            grTask.short_description = payload.short_description;
            grTask.description = payload.description;
            grTask.insert();
      }
    4. 인스턴스의 유효성이 확인되고 매핑이 완료되면 고객은 이제 대상 인스턴스에 푸시할 결과를 선택할 수 있습니다.