TroubleTicketNotificationUtilOOB - Scoped

  • Release version: Zurich
  • Updated July 31, 2025
  • 7 minutes to read
  • The TroubleTicketNotificationUtilOOB script include provides methods used to define and generate the TMF-compliant payloads for trouble ticket notification events.

    Override the methods in this script include to:
    • Add/remove attributes to an existing trouble ticket event type.
    • Define attributes for a new trouble ticket event type.
    For additional information, see Configure trouble ticket notifications using the Producer Event Notification Framework.

    This script include runs within the sn_ind_tsm_sdwan namespace.

    The calling user must have the ticket_integrator role.

    TroubleTicketNotificationUtilOOB - addAdditionalEventAttributes(Object tmfEventPayload)

    Adds custom event header attributes to the passed TMF trouble ticket event payload. The attributes added by this method are added to the event-level header for all trouble ticket events.

    Table 1. Parameters
    Name Type Description
    tmfEventPayload Object TMF-compliant trouble ticket event payload. For details on the format of this event payload, see the TMF621 Trouble Ticket Management API REST Specification v5.0.0 and the TMF688 Event Management API User Guide v4.0.0.
    Table 2. Returns
    Type Description
    None

    The following code example shows how to call this method.

    constructTMFEvent: function(eventId) {
      var troubleTicketEvent = {};
      if (gs.nil(eventId)) {
        troubleTicketEvent.eventId = gs.generateGUID();
      } else {
        troubleTicketEvent.eventId = eventId;
      }
      troubleTicketEvent['@type'] = Constants.EVENT_TYPE_TROUBLE_TICKET;
      this.addAdditionalEventAttributes(troubleTicketEvent);
      return troubleTicketEvent;
    },

    TroubleTicketNotificationUtilOOB - constructTMFEvent(String eventId)

    Generates the TMF688-compliant header attributes in the event section of the payload. These attributes are consistent across all event payloads.

    In the default implementation, this method adds the eventId and the @type header attributes.

    This method calls the helper method addAdditionalEventAttributes(). In this method you can add other header attributes to the event payload. For details, see Modify a trouble ticket event payload.

    Table 3. Parameters
    Name Type Description
    eventId String Unique identifier of the associated event. This can be any unique value. In the default implementation, if you don't pass the event ID, the value is set to a system generated GUID.
    Table 4. Returns
    Type Description
    Object TMF payload with the event-level attributes set. For details on the format of this event payload, see theTMF688 Event Management API User Guide v4.0.0.

    The following code example shows how to call this method to construct the event header attributes when generating a trouble ticket attribute change payload.

    generateTroubleTicketAttributeChangePayload: function(incidentGr, eventType, eventId) {
      var tmfEventPayload = this.constructTMFEvent(eventId);
      tmfEventPayload.eventType = eventType;
      tmfEventPayload.event = this.addAttributeChangeTroubleTicketAttributes(incidentGr);
    
      return tmfEventPayload;
    },

    TroubleTicketNotificationUtilOOB - generateCreateTroubleTicketEventPaylaod(Object incidentGr, String eventType, String eventId)

    Constructs the TMF-compliant payload for the associated create trouble ticket for incident event type.

    This method is executed when the associated event type is TROUBLE_TICKET_CREATE: "TroubleTicketCreateEvent". This method calls two helper methods:
    • constructTMFEvent(): Adds the event header attributes (TMF688) to the payload.
    • addCreateTroubleTicketAttributes(): Override this method to add trouble ticket attributes (TMF621), both mandatory and optional, to the payload. This method is just a stub in the default implementation.

    You can override these helper methods in the TroubleTicketNotificationUtil script include to configure both event header and trouble ticket attributes in the TMF-compliant payload.

    Table 5. Parameters
    Name Type Description
    incidentGr Object JSON formatted glide record that caused the trouble ticket event to be generated. Use the information in this glide record to construct the TMF621-compliant trouble ticket event payload.
    eventType String
    Unique identifier of the associated trouble ticket event type. For the default implementation of this method, this should always be
    "TroubleTicketCreateEvent".

    For a list of all base trouble ticket event types, refer to Constants.EVENT_TYPES in the sn_api_notif_mgmt.Constants script include file.

    eventId String Unique identifier of the associated event.
    Table 6. Returns
    Type Description
    Object TMF-compliant trouble ticket event payload. For details on the format of this event payload, see the TMF621 Trouble Ticket Management API REST Specification v5.0.0 and the TMF688 Event Management API User Guide v4.0.0.

    The following code example shows how to call this method.

    fetchEventHandlerAndCreateTMFEvent: function(eventSnapshot, eventType, eventId) {
      var eventPayload;
      switch (eventType) {
        case Constants.EVENT_TYPES.TROUBLE_TICKET_STATUS_CHANGE:
          eventPayload = new sn_ind_tsm_sdwan.TroubleTicketNotificationUtil().generateTroubleTicketStatusChangePayload(eventSnapshot, eventType, eventId);
          break;
    
        case Constants.EVENT_TYPES.TROUBLE_TICKET_CREATE:
          eventPayload = new sn_ind_tsm_sdwan.TroubleTicketNotificationUtil().generateCreateTroubleTicketEventPaylaod(eventSnapshot, eventType, eventId);
          break;
    
        case Constants.EVENT_TYPES.TROUBLE_TICKET_ATTRIBUTE_CHANGE:
          eventPayload = new sn_ind_tsm_sdwan.TroubleTicketNotificationUtil().generateTroubleTicketAttributeChangePayload(eventSnapshot, eventType, eventId);
          break;
    
        case Constants.EVENT_TYPES.TROUBLE_TICKET_CREATE_FOR_CASE:
          eventPayload = new sn_ind_tsm_sdwan.TroubleTicketNotificationUtil().generateCreateTroubleTicketEventPaylaodForCase(eventSnapshot, eventType, eventId);
          break;
    
        default:
          this._logger.debug("Event with id " + eventId + " could not find the matching payload generator");
          eventPayload = null;
      }
    return eventPayload;
    },

    TroubleTicketNotificationUtilOOB - generateCreateTroubleTicketEventPaylaodForCase(Object incidentGr, String eventType, String eventId)

    Constructs the TMF-compliant payload for the associated create trouble ticket for case event type.

    This method is executed when the associated event type is TROUBLE_TICKET_CREATE_FOR_CASE: "TroubleTicketCreateEventForCase". This method calls two helper methods:
    • constructTMFEvent(): Adds the event attributes (TMF688) to the payload.
    • addCreateTroubleTicketAttributesForCase(): Override this method to add trouble ticket attributes (TMF621), both mandatory and optional, to the payload. This method is just a stub in the default implementation.

    You can override these helper methods in the TroubleTicketNotificationUtil script include to configure both event header and trouble ticket attributes in the TMF-compliant payload.

    Table 7. Parameters
    Name Type Description
    incidentGr Object JSON formatted glide record that caused the trouble ticket event to be generated. Use the information in this glide record to construct the TMF621-compliant trouble ticket event payload.
    eventType String
    Unique identifier of the associated trouble ticket event type. For the default implementation of this method, this should always be
    "TroubleTicketCreateEvent".

    For a list of all base trouble ticket event types, refer to Constants.EVENT_TYPES in the sn_api_notif_mgmt.Constants script include file.

    eventId String Unique identifier of the associated event.
    Table 8. Returns
    Type Description
    Object TMF-compliant trouble ticket event payload. For details on the format of this event payload, see the TMF621 Trouble Ticket Management API REST Specification v5.0.0 and the TMF688 Event Management API User Guide v4.0.0.

    The following code example shows how to call this method.

    fetchEventHandlerAndCreateTMFEvent: function(eventSnapshot, eventType, eventId) {
      var eventPayload;
      switch (eventType) {
        case Constants.EVENT_TYPES.TROUBLE_TICKET_STATUS_CHANGE:
          eventPayload = new sn_ind_tsm_sdwan.TroubleTicketNotificationUtil().generateTroubleTicketStatusChangePayload(eventSnapshot, eventType, eventId);
          break;
    
        case Constants.EVENT_TYPES.TROUBLE_TICKET_CREATE:
          eventPayload = new sn_ind_tsm_sdwan.TroubleTicketNotificationUtil().generateCreateTroubleTicketEventPaylaod(eventSnapshot, eventType, eventId);
          break;
    
        case Constants.EVENT_TYPES.TROUBLE_TICKET_ATTRIBUTE_CHANGE:
          eventPayload = new sn_ind_tsm_sdwan.TroubleTicketNotificationUtil().generateTroubleTicketAttributeChangePayload(eventSnapshot, eventType, eventId);
          break;
    
        case Constants.EVENT_TYPES.TROUBLE_TICKET_CREATE_FOR_CASE:
          eventPayload = new sn_ind_tsm_sdwan.TroubleTicketNotificationUtil().generateCreateTroubleTicketEventPaylaodForCase(eventSnapshot, eventType, eventId);
          break;
    
        default:
          this._logger.debug("Event with id " + eventId + " could not find the matching payload generator");
          eventPayload = null;
      }
    return eventPayload;
    },

    TroubleTicketNotificationUtilOOB - generateTroubleTicketAttributeChangePayload(Object incidentGr, String eventType, String eventId)

    Constructs the TMF-compliant payload for the trouble ticket attribute change event for incident event type.

    This method is executed when the associated event type is TROUBLE_TICKET_ATTRIBUTE_CHANGE: "TroubleTicketAttributeChangeEvent". This method calls two helper methods:
    • constructTMFEvent(): Adds the event attributes (TMF688) to the payload.
    • addAttributeChangeTroubleTicketAttributes(): Override this method to add trouble ticket attributes (TMF621), both mandatory and optional, to the payload. This method is just a stub in the default implementation.

    You can override these helper methods in the TroubleTicketNotificationUtil script include to configure both event header and trouble ticket attributes in the TMF-compliant payload.

    Table 9. Parameters
    Name Type Description
    incidentGr Object JSON formatted glide record that caused the trouble ticket event to be generated. Use the information in this glide record to construct the TMF621-compliant trouble ticket event payload.
    eventType String
    Unique identifier of the associated trouble ticket event type. For the default implementation of this method, this should always be
    "TroubleTicketCreateEvent".

    For a list of all base trouble ticket event types, refer to Constants.EVENT_TYPES in the sn_api_notif_mgmt.Constants script include file.

    eventId String Unique identifier of the associated event.
    Table 10. Returns
    Type Description
    Object TMF-compliant trouble ticket event payload. For details on the format of this event payload, see the TMF621 Trouble Ticket Management API REST Specification v5.0.0 and the TMF688 Event Management API User Guide v4.0.0.

    The following code example shows how to call this method.

    fetchEventHandlerAndCreateTMFEvent: function(eventSnapshot, eventType, eventId) {
      var eventPayload;
      switch (eventType) {
        case Constants.EVENT_TYPES.TROUBLE_TICKET_STATUS_CHANGE:
          eventPayload = new sn_ind_tsm_sdwan.TroubleTicketNotificationUtil().generateTroubleTicketStatusChangePayload(eventSnapshot, eventType, eventId);
          break;
    
        case Constants.EVENT_TYPES.TROUBLE_TICKET_CREATE:
          eventPayload = new sn_ind_tsm_sdwan.TroubleTicketNotificationUtil().generateCreateTroubleTicketEventPaylaod(eventSnapshot, eventType, eventId);
          break;
    
        case Constants.EVENT_TYPES.TROUBLE_TICKET_ATTRIBUTE_CHANGE:
          eventPayload = new sn_ind_tsm_sdwan.TroubleTicketNotificationUtil().generateTroubleTicketAttributeChangePayload(eventSnapshot, eventType, eventId);
          break;
    
        case Constants.EVENT_TYPES.TROUBLE_TICKET_CREATE_FOR_CASE:
          eventPayload = new sn_ind_tsm_sdwan.TroubleTicketNotificationUtil().generateCreateTroubleTicketEventPaylaodForCase(eventSnapshot, eventType, eventId);
          break;
    
        default:
          this._logger.debug("Event with id " + eventId + " could not find the matching payload generator");
          eventPayload = null;
      }
    return eventPayload;
    },

    TroubleTicketNotificationUtilOOB - generateTroubleTicketStatusChangePayload(Object incidentGr, String eventType, String eventId)

    Constructs the TMF-compliant payload for the associated trouble ticket status change event for incident event type.

    This method is executed when the associated event type is TROUBLE_TICKET_STATUS_CHANGE: "TroubleTicketStatusChangeEvent". This method calls two helper methods:
    • constructTMFEvent(): Adds the event attributes (TMF688) to the payload.
    • addStatusChangeTroubleTicketAttributes(): Override this method to add trouble ticket attributes (TMF621), both mandatory and optional, to the payload. This method is just a stub in the default implementation.

    You can override these helper methods in the TroubleTicketNotificationUtil script include to configure both event header and trouble ticket attributes in the TMF-compliant payload.

    Table 11. Parameters
    Name Type Description
    incidentGr Object JSON formatted glide record that caused the trouble ticket event to be generated. Use the information in this glide record to construct the TMF621-compliant trouble ticket event payload.
    eventType String
    Unique identifier of the associated trouble ticket event type. For the default implementation of this method, this should always be
    "TroubleTicketCreateEvent".

    For a list of all base trouble ticket event types, refer to Constants.EVENT_TYPES in the sn_api_notif_mgmt.Constants script include file.

    eventId String Unique identifier of the associated event.
    Table 12. Returns
    Type Description
    Object TMF-compliant trouble ticket event payload. For details on the format of this event payload, see the TMF621 Trouble Ticket Management API REST Specification v5.0.0 and the TMF688 Event Management API User Guide v4.0.0.

    The following code example shows how to call this method.

    fetchEventHandlerAndCreateTMFEvent: function(eventSnapshot, eventType, eventId) {
      var eventPayload;
      switch (eventType) {
        case Constants.EVENT_TYPES.TROUBLE_TICKET_STATUS_CHANGE:
          eventPayload = new sn_ind_tsm_sdwan.TroubleTicketNotificationUtil().generateTroubleTicketStatusChangePayload(eventSnapshot, eventType, eventId);
          break;
    
        case Constants.EVENT_TYPES.TROUBLE_TICKET_CREATE:
          eventPayload = new sn_ind_tsm_sdwan.TroubleTicketNotificationUtil().generateCreateTroubleTicketEventPaylaod(eventSnapshot, eventType, eventId);
          break;
    
        case Constants.EVENT_TYPES.TROUBLE_TICKET_ATTRIBUTE_CHANGE:
          eventPayload = new sn_ind_tsm_sdwan.TroubleTicketNotificationUtil().generateTroubleTicketAttributeChangePayload(eventSnapshot, eventType, eventId);
          break;
    
        case Constants.EVENT_TYPES.TROUBLE_TICKET_CREATE_FOR_CASE:
          eventPayload = new sn_ind_tsm_sdwan.TroubleTicketNotificationUtil().generateCreateTroubleTicketEventPaylaodForCase(eventSnapshot, eventType, eventId);
          break;
    
        default:
          this._logger.debug("Event with id " + eventId + " could not find the matching payload generator");
          eventPayload = null;
      }
    return eventPayload;
    },