Configure onTimeEntryCreate, onTimeEntryUpdate, and onTimeEntryDelete

onTimeEntryCreate

When time logs are entered for a ticket in the Freshworks product (on which the app is deployed), the onTimeEntryCreate event is triggered.

Subscribe to the onTimeEntryCreate event and register the callback by using the following sample manifest.json content.

manifest.json
"events": {
  "onTimeEntryCreate": {
      "handler": "onTimeEntryCreateCallback"
  }
}

Define the corresponding callback by using the following sample server.js content:

server.js
exports = {
  onTimeEntryCreateCallback: function(payload) {
    console.log("Logging arguments from onTimeEntryCreate event: " + JSON.stringify(payload));
    console.log("Time Entry Note- ", payload.data.time_entry.note, "\n Agent Name - ", payload.data.actor.name);
  }
}

Attributes of the data object

  • actorobject

    Information pertaining to the agent who triggers the time entry event in the Freshdesk system.

  • agentobject

    Information pertaining to the agent assigned to the ticket in the Freshdesk system.

  • time_entryobject

    Information pertaining to the time logs entered for a ticket.

onTimeEntryUpdate

The onTimeEntryUpdate event is triggered when,

  • The agent name associated with the time log is modified.
  • The billability status is modified.
  • A time log note is added or modified.
  • A time entry is manually added to the time log or an existing entry is modified.
  • The auto-timer is started or stopped.

Subscribe to the onTimeEntryUpdate event and register the callback by using the following sample manifest.json content.

manifest.json
"events": {
  "onTimeEntryUpdate": {
    "handler": "onTimeEntryUpdateCallback"
  }
}

Define the corresponding callback by using the following sample server.js content:

server.js
exports = {
  onTimeEntryUpdateCallback: function(payload) {
    console.log("Logging arguments from onTimeEntryUpdate event: " + JSON.stringify(payload));
  }
}

Attributes of the data object

  • actorobject

    Information pertaining to the entity who triggers the onTimeEntryUpdate event in the Freshdesk system.

  • agentobject

    Information pertaining to the agent assigned to the ticket in the Freshdesk system.

  • time_entryobject

    Information pertaining to the modifed time logs.

onTimeEntryDelete

When a time entry is deleted, the onTimeEntryDelete event is invoked and the registered callback method is executed.

Subscribe to the onTimeEntryDelete event and register the callback by using the following sample manifest.json content.

manifest.json
"events": {
  "onTimeEntryDelete": {
    "handler": "onTimeEntryDeleteCallback"
  }
}

Define the corresponding callback by using the following sample server.js content:

server.js
exports = {
  onTimeEntryDeleteCallback: function(payload) {
    console.log("Logging arguments from onTimeEntryDelete event: " + JSON.stringify(payload));
  }
}

Attributes of the data object

  • actorobject

    Information pertaining to the entity who triggers the onTimeEntryDelete event in the Freshdesk system.

  • time_entryobject

    Information pertaining to the deleted time logs.