Configure onTopicCreate, onTopicUpdate, and onTopicDelete

onTopicCreate

When an agent or an end user of the Customer Support Portal, adds a topic to a forum, the onTopicCreate event is triggered.

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

manifest.json
"events": {
  "onTopicCreate": {
      "handler": "onTopicCreateCallback"
  }
}

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

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

Attributes of the data object

  • actorobject

    Information pertaining to the entity who triggered the onTopicCreate event in the Freshdesk system.

  • associationsobject

    All associated objects of the forum object, that specify additional information pertaining to the forum.

  • topicobject

    Information pertaining to the topic added to a forum in the Freshdesk system.

onTopicUpdate

When a topic’s properties are modified, the onTopicUpdate event is triggered.

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

manifest.json
"events": {
  "onTopicUpdate": {
      "handler": "onTopicUpdateCallback"
  }
}

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

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

Attributes of the data object

  • actorobject

    Information pertaining to the entity who triggered the onTopicUpdate event in the Freshdesk system.

  • associationsobject

    All associated objects of the topic object, that specify additional information pertaining to the topic created in the Freshdesk system.

  • changesobject

    Changes that triggered the onTopicUpdate event, specified as a JSON object of the following format:

    "changes": {
      "misc_changes": {},
      "model_changes": {
          //For non-array attributes
          "<topic.attribute that changed>": ["Old value", "New value"]
      },
      "system_changes": {}
    }

    Example:

    "changes": {
      "misc_changes":{},
      "model_changes": {
          "body": [
            "Sample Topic",
            "Sample Topic body"
          ]
      },
      "system_changes":{}
    }
  • topicobject

    Information pertaining to the topic modified in the Freshdesk system.

onTopicDelete

When a topic is deleted from the Freshworks system, the onTopicDelete event is triggered.

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

manifest.json
"events": {
  "onTopicDelete": {
      "handler": "onTopicDeleteCallback"
  }
}

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

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

Attributes of the data object

  • actorobject

    Information pertaining to the entity who deleted the group details.

  • associationsobject

    All associated objects of the topic object, that specify additional information pertaining to the group in the Freshdesk system.

  • topicobject

    Information pertaining to the topic deleted from the Freshdesk system.