Configure onChangeCreate and onChangeUpdate

onChangeCreate

When a change is created in the Freshworks system, the onChangeCreate event is triggered.

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

manifest.json
"events": {
  "onChangeCreate": {
    "handler": "onChangeCreateCallback"
  } 
}

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

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

Attributes of the data object

  • actorobject

    Information pertaining to the system, agent, or requester who triggered the onChangeCreate event in the Freshworks system.

  • changeobject

    Information pertaining to the change created in the Freshworks system.

onChangeUpdate

When change details are updated in the Freshworks system, the onChangeUpdate event is triggered.

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

manifest.json
"events": {
  "onChangeUpdate": {
    "handler": "onChangeUpdateCallback"
  }
}

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

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

Attributes of the data object

  • actorobject

    Information pertaining to the system, agent, or requester who triggered the onChangeUpdate event in the Freshworks system.

  • changeobject

    Information pertaining to the change updated in the Freshworks system.

  • changesobject

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

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

    Example

    "changes": {
      "custom_fields": {
        "custom_number_field": [
          1234,
          1234567
         ]
      },
      "requester_id": [
        37656,
        37659
      ]
     }
    }