Scenario: Convert Incident to Service Request
Currently, only incident requests can be created via email using the default template. However, Zylker wants to create service requests based on specific keywords found in the email, aligning with their IT Service Management (ITSM) scenario.
If the email contains keywords such as "new account deployment," "password reset," or "software installation," it should automatically generate a service request instead of an incident request.
- Go to Setup > Automation > Triggers
- In the requests module, create a new trigger with the following fields:
- Name - Incident to Service CF
- Execute when a request is - Created
- Execute during - Anytime
- Condition 1 - Subject contains Software installation, Software deployment, software
- Condition 2 (with logical OR operator)- Description contains Software installation, Software deployment, software
- Action - Custom Function
- Input the below custom function by adding the service request template name under "tempName".
- tempName = "Software Deployment Request";
- //
- apiPrefix = "/app/" + context.get("instance") + "/api/v3/";
- update = zoho.sdp.invokeurl
- [
- url :apiPrefix + "requests/" + requestObj.get("id")
- type :PUT
- parameters:{"input_data":{"request":{"template":{"name":tempName}}}}
- ];
- info update;

Disclaimer: Trigger automation is a post-operation process, meaning it is applied after the request is created. Therefore, all notifications and operations configured for incident requests will be executed successfully. After these processes, the request will be converted into a service request according to the custom function.
Scenario: Status Change
In ServiceDesk Plus MSP Cloud, requests are reopened when the requester replies back to a request, but not when they add notes to a request. However, the administrators at Zylker want to move the request status to "Open" if the requester adds a public note to the request.
- Go to Setup > Automation > Triggers.
- In the requests module, create a new trigger with the following fields:
- Name - Status change
- Trigger Applies to - Notes
- Execute when a request is - Created
- Execute during - Anytime
- Condition - Is Public is Yes
- Action - Custom Function
- Input the below custom function below:
- statusToBeUpdated = "Open";
- parentObj = context.get("parent");
- requestObj = parentObj.get("request");
- requestId = requestObj.get("id");
- requesterId = requestObj.get("requester").get("id");
- createdById = requestnoteObj.get("created_by").get("id");
- //
- if(requesterId.equals(createdById))
- {
- updatereq = zoho.sdp.invokeurl
- [
- url :"/app/" + context.get("instance") + "/api/v3/requests/" + requestId
- type :PUT
- parameters:{"input_data":{"request":{"status":{"name":statusToBeUpdated}}}}
- ];
- }

Ensure to update the required status in the first line of the script. The above script can be used in common for other triggers/sub entities as per the organization's requirement.