Custom Triggers

    The Custom Triggers feature, as the name indicates, helps customize automatic workflows for different types of user requests. Using this feature, the SD admin can automate several processes, such as setting up multiple approval stages, sending customized email notifications, creating a new request based on resources field information, and setting up integration with third-party applications.

    Triggering the defined workflow

    An action is triggered for new requests that match the conditions you specify. These conditions refer to the values that certain fields in the request must hold, and are checked when a request is created, updated, created and updated, approved, rejected, approved or rejected and when a new reply is received for the request. 

    Custom Trigger is executed when a request is duplicated/copied, when an incident request is converted to a service request and when a new request is created through preventive maintenance tasks (scheduled requests). For new requests, when the custom trigger is executed with empty criteria, the resulting script output may/may not update the request fields (based on the script input). If those request fields are updated, it ignores the 'update request' custom triggers. For modified requests, when the latest value of the modified fields matches the custom trigger criteria, then the custom trigger is executed. 

    • 'Mandatory field mark' can be removed from 'Match the below criteria' section by executing the below query in the database.
    • Update globalconfig set paramvalue = 'true' where category='CUSTOM_TRIGGER' and parameter='IS_EMPTY_CRIT_ALLOWED';

    This document briefly discusses how to set up a workflow using custom triggers.

    Configuring Custom Triggers

    • Go to Admin>>Custom Triggers 
    • On the page that opens, the SD admin can add a new action, enable or disable an action, edit an action, or delete an action.

    The admin can also define the sequence of the order in which the actions must be applied to a request.

    The following screenshot describes the process to add a new action.

    Email Notification

    Email notification allows you to notify users about important events in a request's cycle. You can notify technicians about high priority or important requests right when it is being created or notify requesters after their tickets get assigned to technicians. You can create new templates for these email notifications and save them. These saved templates will be listed under the email notification template window.

    • Set criteria and click Add icon next to Email Notification.
    • Email notification template window is opened.
    • Choose a template (Templates which you have already created will be listed here) and select users you want to notify by using the variables / placeholders / organization roles.
    • Supported placeholders are as follows 
      • $Requester
      • $Account_Manager
      • $Ticket_Owner
      • $Group_Members
      • $On_Behalf_Of_Users
      • $Editor
      • $CC_Users
      • $Shared_Requesters
      • $Shared_Technicians
      • $Task_Owners
      • $Linked_To_Request_Owner
      • $Linked_Requests_Owners
      • $Dependent_Requests_Owners
      • $Account_Manager

    • You can also create a new template from that window itself. Click New Template button for that.

    Click Save.

    Configuring Actions

    Let's consider the script, py $COMPLETE_V3_JSON_FILE, which is configured for sending an SMS each time a request arrives with "Group" set to "network" and "Priority" set to "High." The supported input arguments for this script are:

    • $COMPLETE_V3_JSON_FILE: Complete request data will be saved to a JSON file temporarily and the file path will be passed as a string object

      When a request is updated, the difference between the previous data and updated data will be available in this file.

    • All the request parameters listed here can be passed as arguments.

    By default, the scripts will run from the [SDP_Home]/integration/custom_scripts/ directory. The languages supported include Python, VBScript, PowerShell, Batch, and so on.

    Writing Custom Scripts

    You have to program the actions to be performed, in a script file. By default, the following request operations are supported:

    Follow the steps described in the document given below to program the required actions effectively.

    Related documents:

    Use cases of Custom Triggers FAQs | Request Custom Menu | Change Custom Triggers | Field and Form Rules


    If you have any questions about Custom Triggers, please post it in our community forum.

    Copyright © 2017, ZOHO Corp. All Rights Reserved.