{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":375,"path":"api-reference/developer-guides/prd_evt_not-dev_gd-add_bus_rule.md","title":"Add a business rule for a new trouble ticket event","bundle":null,"doc_type":null,"release":"australia","body":"\n# Add a business rule for a new trouble ticket event\n\nWhen adding a new trouble ticket event to your implementation, you must add a business rule to your ServiceNow instance.\n\nThis business rule must push the Glide snapshot of the corresponding incident or case record into the Producer Notification Framework inbound queue, Inbound Queue \\[sn\\_tmt\\_core\\_inbound\\_queue\\] table, where it is then processed and published by the Producer Notification Framework.\n\nThe following code snippet shows an example of a business rule for processing the `ResolveTroubleTicketEventForIncident` ticket notification event on the Incident \\[incident\\] table. When calling the pushEventsToQueue\\(\\) method to push the event onto the inbound queue, you must pass the event type. For this example it is `ResolveTroubleTicketEventForIncident`. This event type can be any alphanumeric value that you want, but it must be unique as it is used by the system to determine how to process the trouble ticket event. The list of event types for the base system are defined in the **Constants.EVENT\\_TYPES** object in the `Constants [sn_api_notif_mgmt.Constants]` script include.\n\nFor details on creating a business rule, see [Create a business rule for your service](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/employee-service-management/ur-create-busrule-service.md).\n\n```\n// Add following lines of code in script section (Advanced tab) of BR for pushing ‘ResolveTroubleTicketEventForIncident’ to the inbound queue.\n\n(function executeRule(current, previous /*null when async*/ ) {\n\n// Note that event needs to be passed at BR level itself as after this step, we would be left with glide snapshot only\n\nnew TroubleTicketNotificationUtil().pushEventsToQueue(current,'ResolveTroubleTicketEventForIncident', Constants.TROUBLE_TICKET_TYPE.INCIDENT);\n\n})(current, previous)\n```\n\n"}}