Request custom functions can be used in business rules, request custom triggers, request life cycle, and request timer actions. To create request custom functions, go to Admin > Incident Management > Request Custom Function.
Custom actions are actionable custom functions that allow users to manipulate data in ServiceDesk Plus and other external applications. Custom functions are built on Deluge, Zoho's propriety scripting language.
Custom actions can be used in Business Rule, Custom Trigger, Request Life cycle, and Request Timer Actions to perform actions on requests, other modules, and external applications.
Use the following pointers to create, enable, disable, and delete custom actions.
Use the New button to create a custom action.
The Actions button allows you to bulk delete, disable, and enable custom actions. To modify individual custom actions, use the icons displayed next to the custom action. Note that only active custom actions will be available to use in the aforementioned configurations.
Use keywords to search custom actions in the field provided. Use the filters on top to display the custom actions used in specific features.
As demonstrated in the following screenshot, 'requestObj' and 'context' will be passed as arguments for the custom function:

You must write the custom function with requestObj as the argument.
After executing the custom function, the Map data type will be returned in the following format:
You can update the request fields, add notes, and add conditional approvals for the request by returning the map from the custom function. The format used in these custom functions are same as the python script and class. For more details, visit this page.
The new field values must be returned from the custom function in a specific format as demonstrated below:
Let's consider a sample script to update request subject to 'Firewall Upgrade' and Priority to 'High'.
returnjson = {
"operation": [{
"INPUT_DATA": [{
"request": {
"subject": "Firewall Upgrade",
"priority": {"name": "High"}
}
}],
"OPERATIONNAME": "UPDATE",
"FORMAT": "V3"
}],
"result": "success",
"message": "Request updated!!"
};
return returnjson;
Let's say you want to assign high priority to requests from Network/Internet category. You can automate this action by using the following script in a business rule action/custom trigger action/requst life cycle:
returnjson = Map();
if(requestObj.containsKey("category"))
{
if(requestObj.get("category").get("name") == "Internet" || requestObj.get("category").get("name") == "Network")
{
returnjson = {
"operation": [{
"INPUT_DATA": [{
"request": {
"priority": {"name": "High"}
}
}],
"OPERATIONNAME": "UPDATE",
"FORMAT": "V3"
}],
"result": "success",
"message": "Request updated!!"
};
}
}
return returnjson;
After writing the custom function, you can test it by following the steps given below:
When you test a custom function, you can debug the code and print the output by using a statement called info. For example, to understand the structure of requestObj and context, you can simply run the following script and study the response.
info
requestObj;