@rajezz We suspect the problem roots from how the product events have been declared. Can you try one of the following to see the problem is solved?
Platform Version 2.0
manifest.json
{
"platform-version": "2.0",
"product": {
"freshdesk": {
"location": {
"ticket_sidebar": {
"url": "index.html",
"icon": "styles/images/icon.svg"
}
}
}
}
}
Declaration of serverless product events in server.js
exports = {
events: [
{ event: 'onTicketCreate' , callback: 'onTicketCreateHandler' },
{ event: 'onAppInstall' , callback: 'onAppInstallHandler' },
{ event: 'onExternalEvent', callback: 'onExternalEventHandler' },
{ event: 'onAppUninstall' , callback: 'onAppUninstallHandler' }
],
onAppInstallHandler: function(args) {
generateTargetUrl()
.then(function(url) {
console.log(url);
// Make request to third party products (ex. JIRA) to register the webhook for this Url
renderData();
}, function(err) {
console.log(err);
renderData({
message: 'Error generating target Url'
});
});
},
onTicketCreateHandler: function(args) {
console.log(args);
},
onExternalEventHandler: function(args) {
// Events pushed from third pary products (ex. JIRA)
},
onAppUninstallHandler: function(args) {
// De-Register webhook from third party
renderData();
}
};
if in case,
Platform Version 2.1
manifest.json
{
"platform-version":"2.1",
"product":{
"freshdesk":{
"location":{
"ticket_sidebar":{
"url":"index.html",
"icon":"styles/images/icon.svg"
}
},
"events":{
"onTicketCreate":{
"handler":"onTicketCreateHandler"
},
"onTicketUpdate":{
"handler":"onTicketUpdateHandler"
}
}
}
}
}
Declaration of serverless product events in server.js
exports = {
"onTicketCreate": function(){...},
"onTicketUpdate": function(){...}
}
It is not allowed to declare the serverless events in Platform version 2.1 -> manifest.json and define them in the way of Platform version 2.0 -> Declaration of serverless product events in server.js or the vice versa.
In other words,
if using Platform version 2.0
then
1. No events to be declared in manifest.json
2. Events and call backs to be declared as an array in the server.js
if using Platform version 2.1
then
1. Events to be declared as nested objects within the product in the manifest.json
2. Events functions must be declared in the exports section directly in the server.js