Front-end events are actions on the product UI, such as button clicks and changes/updates to the UI field values. Events method is an interface that the developer platform provides, to enable your app to react to front-end events.
To enable your app to react to front-end events, in the app.js file,
- Subscribe to the app.initialized event, through an event listener. When the app is initialized, the parent application passes a client reference to the app.
- After app initialization,
- Use the client reference, subscribe to <Event name> and register a callback method to be executed when the event occurs.
- Define the callback method.
When the event occurs, a payload is passed to the callback method. Let us call this payload event. event.type returns the name of the event. The event.helper.getData() helper method returns a JSON object that contains information pertaining to the event. Your app logic can process this data into meaningful results.
For a demonstration of this feature, take a look at the events method sample app.
This section,
- Lists, page-wise, all the front-end events to which the app can react.
- Provides sample payloads that are passed to the callback methods, when the events occur.
- Describes the payload attributes.
Click events
These events occur when a user clicks a button or link on the page. The event.helper.getData() method returns an empty JSON for most of these events, the only exception being timer events.
Change events
These events occur when a user changes the value of a field on the UI.
Note:User need not submit the modified value for the event listeners to pick up the event and execute the callback; merely changing the values is sufficient for the event trigger.
The event.helper.getData() method returns a JSON that contains the old and new values of the changed field.
Intercept events
These are events that are paused, while the event listener and the corresponding callback run. The app can choose to allow the original event to complete or block the event.
To enable your app to intercept an event, after app initialization,
- Use the client reference, subscribe to event, register a callback method to be executed when the event occurs, and set intercept as true.
- Define the callback method.
- To allow the event to proceed, use the event.helper.done() helper method.
- To prevent the event from completion, use the event.helper.fail(‘errorMessage’) helper method.
- To obtain data pertaining to the event, use the event.helper.getData() helper method. If your app is intercepting a click event, the method returns an empty JSON.
Global event
Event name | Event trigger |
---|---|
cti.triggerDialer | When a user clicks the call icon or phone number link that is displayed on any of the following pages of the product UI:
|
cti.triggerDialer
Use the sample code shown on the right pane > Sample code tab, to enable your app to react to user clicks such as the click on a call icon or phone number, on the UI.
Ticket details page events
Event name | Event trigger |
---|---|
Click events | |
ticket.replyClick | When a user clicks the Reply button to open the editor window. |
ticket.sendReply | When a user clicks the Send button. |
ticket.forwardClick | When a user clicks the Forward button to open the editor window. |
ticket.conversationForward | When a user clicks the Forward icon in the conversation. |
ticket.forward | When a user clicks the Forward button inside the editor window, the ticket or conversation is forwarded. |
ticket.notesClick | When a user clicks the Notes button to open the editor window. |
ticket.addNote | When a user clicks the Add Note option from the editor window, a private or public note is added. |
ticket.closeTicketClick | When a user clicks the Close button located on the top navigation bar of the Ticket details page. |
ticket.deleteTicketClick | When a user clicks the Delete button located on the top navigation bar of the Ticket details page. |
ticket.previousTicketClick | When a user clicks the previous ticket icon at the top right of the Ticket details page. |
ticket.nextTicketClick | When a user clicks the next ticket icon at the top right of the Ticket details page. |
ticket.startTimer | When a user clicks the Start or Add Timer button. |
ticket.stopTimer | When a user clicks the Stop Timer button. |
ticket.updateTimer | When a user clicks the Update Timer button. |
ticket.deleteTimer | When a user clicks the Delete Time Entry button. |
Change events | |
ticket.priorityChanged | When a user changes the priority of a ticket. |
ticket.statusChanged | When a user changes the status of a ticket. |
ticket.groupChanged | When a user changes the group to which a ticket is assigned. |
ticket.agentChanged | When a user changes the agent to whom the ticket is assigned. |
ticket.typeChanged | When a user changes the type of the ticket. |
Intercept events | |
ticket.closeTicketClick | When a user clicks the Close button located on the top navigation bar of the Ticket details page. |
ticket.deleteTicketClick | When a user clicks the Delete button located on the top navigation bar of the Ticket details page. |
ticket.propertiesUpdated | When a user updates any ticket property and clicks the Update button on the Ticket details page. |
ticket.sendReply | When a user clicks the SEND button on the Ticket details page. |
New ticket page events
Event name | Event trigger |
---|---|
Change events | |
ticket.priorityChanged | When a user changes the priority of a ticket. |
ticket.statusChanged | When a user changes the status of a ticket. |
ticket.groupChanged | When a user changes the group to which a ticket is assigned. |
ticket.agentChanged | When a user changes the agent to whom a ticket is assigned. |
ticket.typeChanged | When a user changes the type of a ticket. |
New email page events
Event name | Event trigger |
---|---|
Change events | |
ticket.fromChanged | When a user changes the From address of a ticket. |
ticket.priorityChanged | When a user changes the priority of a ticket. |
ticket.statusChanged | When a user changes the status of a ticket. |
ticket.groupChanged | When a user changes the group to which a ticket is assigned. |
ticket.agentChanged | When a user changes the agent to whom a ticket is assigned. |
ticket.typeChanged | When a user changes the type of a ticket. |
Event and payload descriptions
ticket.replyClick
Use the sample code shown on the right pane > Sample code tab, to enable your app to react to a user's click on the Reply button that opens the editor window.
ticket.sendReply
Use the sample code shown on the right pane > Sample code tab, to enable your app to react to a user's click on the Send button.
ticket.forwardClick
Use the sample code shown on the right pane > Sample code tab, to enable your app to react to a user's click on the Forward button that opens the editor window.
ticket.conversationForward
Use the sample code shown on the right pane > Sample code tab, to enable your app to react to a user's click on the Forward icon in the conversation that opens the editor window.
ticket.forward
Use the sample code shown on the right pane > Sample code tab, to enable your app to react to a user's click on the Forward button in the editor window to forward the ticket or conversation.
ticket.notesClick
Use the sample code shown on the right pane > Sample code tab, to enable your app to react to a user's click on the Add note button that opens the editor window.
ticket.addNote
Use the sample code shown on the right pane > Sample code tab, to enable your app to react to a user's click on the Add Note button in the editor window, which adds a private or public note to the ticket.
ticket.closeTicketClick
Use the sample code shown on the right pane > Sample code tab, to enable your app to react to a user's click on the Close button located on the top navigation bar of the Ticket details page.
ticket.deleteTicketClick
Use the sample code shown on the right pane > Sample code tab, to enable your app to react to a user's click on the Delete button located as a menu item in the Ticket details page.
ticket.previousTicketClick
Use the sample code shown on the right pane > Sample code tab, to enable your app to react to a user's click on the Previous icon located at the top right of the Ticket details page.
ticket.nextTicketClick
Use the sample code shown on the right pane > Sample code tab, to enable your app to react to a user's click on the Next icon located at the top right of the Ticket details page.
ticket.startTimer
Use the sample code shown on the right pane > Sample code tab, to enable your app to react to a user's click on the Start Timer button to start the timer from the TIME LOGS widget. It is also triggered when the user adds a time entry and clicks the Save button.
ticket.stopTimer
Use the sample code shown on the right pane > Sample code tab, to enable your app to react to a user's click on the Stop button to stop a running timer.
ticket.updateTimer
Use the sample code shown on the right pane > Sample code tab, to enable your app to react to a user's click on the UPDATE button to update an existing time entry.
ticket.deleteTimer
The event is triggered when a user deletes an existing time entry. Use the sample code shown on the right pane > Sample code tab, to enable your app to react to a user's click on the Delete button to delete an existing time entry.
ticket.priorityChanged
Use the sample code shown on the right pane > Sample code tab, to enable your app to react when a user changes the priority of a ticket.
ticket.statusChanged
Use the sample code shown on the right pane > Sample code tab, to enable your app to react when a user changes the status of a ticket.
ticket.groupChanged
Use the sample code shown on the right pane > Sample code tab, to enable your app to react twhen a user changes the group assigned to a ticket.
ticket.agentChanged
Use the sample code shown on the right pane > Sample code tab, to enable your app to react when a user changes the agent assigned to a ticket.
ticket.typeChanged
Use the sample code shown on the right pane > Sample code tab, to enable your app to react when a user changes the type of a ticket.
ticket.closeTicketClick
Use the sample code shown on the right pane > Sample code tab, to enable your app to react to a user's click on the Close button located on the top navigation bar of the Ticket details page.
ticket.deleteTicketClick
Use the sample code shown on the right pane > Sample code tab, to enable your app to react to a user's click on the the Delete button located as a menu item in the Ticket details page.
ticket.propertiesUpdated
Use the sample code shown on the right pane > Sample code tab, to enable your app to react when a user updates any ticket property and clicks the Update button located in the PROPERTIES section of the Ticket details page.
ticket.sendReply
Use the sample code shown on the right pane > Sample code tab, to enable your app to react to a user's click on the Send button in the editor window.
ticket.fromChanged
Use the sample code shown on the right pane > Sample code tab, to enable your app to react when a user changes the From address of a ticket.