Configure onChangeCreate and onChangeUpdate

Marketplace Platform v2.3 deprecation:We’re continuing to improve the Marketplace Platform to deliver stronger security, better performance, and new capabilities. As part of this evolution, Marketplace Platform v2.3 will be deprecated. To learn the dates and next steps, see Migration guide.

onChangeCreate

When a change is created in the Freshservice 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 Freshservice system.

  • changeobject

    Information pertaining to the change created in the Freshservice system.

onChangeUpdate

When change details are updated in the Freshservice 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 Freshservice system.

  • changeobject

    Information pertaining to the change updated in the Freshservice system.

  • changesobject

    Changes that triggered the onChangeUpdate 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
      ]
     }
    }