Custom Triggers
The Custom Triggers feature, as the name indicates, helps customize automatic workflows for different types of user requests. Using this feature, the SDAdmin 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, deleted permanently, approved, rejected or 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). In such cases, the previously executed custom trigger configured with a custom script to update a request will be ignored. For modified requests, when the latest value of the modified fields matches the custom trigger criteria, then the custom trigger is executed.
Custom Triggers are categorized and executed in groups. To create a new group,
-
Click Trigger Group.
-
Provide a Name and Description for the group.
-
Click Add. The group will be added to the list.
To create a new Custom Trigger,
-
Hover over the required group and click Add Trigger.
-
Fill out the displayed form using the following pointers:
-
Trigger Name: Provide a name for the trigger.
-
Description: Describe the trigger or add relevant notes.
-
Execute on actions: Choose whether the trigger should be executed when the request is created, edited, approved, rejected, or deleted permanently. Choosing Deleted Permanently enables you to trigger notifications to specific users when the request is deleted from trash.
Note: The options Approved, Rejected, and Deleted Permanently cannot be combined with any other option. -
Execute during: Using this option, you can choose to execute the trigger only within or other than operational hours. The default choice is Any Time.
-
Cascade Execution: Use this option to modify the order of the next applied trigger. You can choose to skip all remaining triggers in the current group or even across all groups.
-
Criteria: Choose the criteria for requests using the drop-down lists. You can configure up to 50 criteria in AND/OR combinations for a business rule.
-
You can also configure multiple sub-criteria for a given criteria. The sub-criteria will be further checked for a request after the criteria is verified.
-
For fields such as Requester, Technician, Groups, etc., you can configure criteria for dynamic input using placeholders such as $All my groups, $Logged in user, etc.
-
For fields such as Status, Created by, Department, etc., you can configure criteria based on the corresponding sub-fields by clicking > beside them.
-
Execute Rule when the criteria is met: This option is available only if you have chosen to apply the trigger when a request is edited. Choose whether the trigger must be applied only for the first time or every time the criteria is met.
-
Actions: Choose whether to execute actions or abort process for incoming requests.
-
If you choose to Abort process execution, provide the reason for the negation. You can use this option in combination with cascade execution to restrict business rule execution on specific requests.
-
If you choose to Execute custom actions, configure the actions to perform when a request satisfies the specified criteria. You can choose to update request fields, execute custom scripts, or custom functions. You can choose to Override request values with Business Rule values using the toggle button available under each action.
Learn more about each custom action here. -
Click Save.
Configuring Custom Actions
Notifications
With email notifications, 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.
To configure email notification as the custom action,
-
Under actions, click Select Custom Action > Notification Action. The email notification template window opens.
-
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
-
$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
Note: You can also use additional fields as variables.
-
You can also create a new template by clicking New Template from the displayed form.
-
Enter the recipients of the email/SMS. You can manually enter the mail IDs or choose from the list of placeholders.
-
Click Save.
Writing Custom Scripts
You have to program the actions to be performed, in a script file. By default, the following request operations are supported:
-
Adding notes to a request
-
Updating a request
-
Conditional approvals for requests
Writing Custom Functions
By executing custom functions in request custom triggers, you can manipulate data in ServiceDesk Plus MSP and other external applications. requestObj and context are the arguments supported in custom functions.
List View
From the custom triggers list view page, you can manage trigger groups and custom triggers with various actions as listed below:
-
View Triggers in a Trigger Group: To view the custom triggers configured within a group, click
beside the required group.
-
Enable/Disable Trigger: You can enable/disable a custom trigger from the list view using the toggle button beside the required trigger.
-
Cascade Execution: You can modify the option configured for cascade execution of a custom trigger from the list view. To do this, click the cascade execution drop-down beside the trigger and choose the required option.
-
Edit Group: To edit a trigger group, click
beside the required group name. Modify the details and click Update.
-
Edit Business Rule: To edit a custom trigger, expand the trigger group and click
beside the required trigger. Modify the details and click Update.
-
Delete Group: To delete an existing trigger group, select the required groups by enabling the corresponding checkboxes and click
. A confirmation message pops up. Click Proceed to complete the action.