Callback functions allow you to manipulate data within ServiceDesk Plus Cloud whenever an event occurs in an external application. For example, you can write a callback function to notify and update the necessary information in ServiceDesk Plus Cloud, each time a ticket is added in your bug tracking software. A callback function is the same as a webhook, only triggered from an external application to perform a task within ServiceDesk Plus Cloud.
Callback functions are internally executed through custom functions, which allow you to perform all types of actions including API calls to external applications.
To learn more about Callback functions, click here.
To write a custom function that can be used as a callback function, follow the steps given below:
Go to Setup > Developer Space > Custom Functions > Callback Functions.
Click New custom function.
Provide a name and description for your custom function.
Write the custom function on the Deluge Script Editor by using the following pointers and then save the function:
Define the parameters required by the callback function. The custom function must return a 'Map' object. The returned Map object is currently not processed.
You can also return an empty map by using the following syntax:
The following script adds a note to a specific request when the callback function is invoked.
After writing the custom function, you can test it by clicking Save & Execute Script. The script will be executed and a success/failure message will be displayed.