onTicketCreate
When a new ticket is created in the Freshservice system, the onTicketCreate event is triggered.
Subscribe to the onTicketCreate event and register the callback by using the following sample manifest.json content.
"events": {
"onTicketCreate": {
"handler": "onTicketCreateCallback"
}
}
Define the corresponding callback by using the following sample server.js content:
exports = {
onTicketCreateCallback: function(payload) {
console.log("Logging arguments from onTicketCreate event: " + JSON.stringify(payload));
}
}
Attributes of the data object
- actorobject
Information pertaining to the system, agent, or requester who triggered the onTicketCreate event in the Freshservice system.
- requesterobject
Information pertaining to the requester who raised the ticket in the Freshservice system.
- ticket
Information pertaining to the ticket raised in the Freshservice system. Submitting a ticket triggers the onTicketCreate event.
onTicketUpdate
The onTicketUpdate event is triggered in the Freshservice system when,
- The status changes
- The priority changes
- The group changes
- The agent changes
- A ticket is deleted
- A ticket is marked as spam
- The type changes
- The source changes
- A ticket is escalated for any reason
- A ticket is escalated due to breaching the first response time.
The onTicketUpdate event is not triggered when:
- The custom field are updated.
- The tags are updated.
Note:Replies or note additions are not considered ticket updates, you need to use the onConversationCreate event to handle them.
Subscribe to the onTicketUpdate event and register the callback by using the following sample manifest.json content.
"events": {
"onTicketUpdate": {
"handler": "onTicketUpdateCallback"
}
}
Define the corresponding callback by using the following sample server.js content:
exports = {
onTicketUpdateCallback: function(payload) {
console.log("Logging arguments from onTicketUpdate event: " + JSON.stringify(payload));
}
}
Attributes of the data object
- actorobject
Information pertaining to the system, agent, or requester who triggered the onTicketUpdate event in the Freshservice system.
- changesobject
Changes that triggered the onTicketUpdate event, specified as a JSON object of the following format:
"changes": { //For non-array attributes "<ticket.attribute that changed>": ["Old value", "New value"] }
- requesterobject
Information pertaining to the requester who raised the ticket in the Freshservice system.
- ticket
Information pertaining to the ticket modified in the Freshservice system.