Custom Triggers for Requests
Custom Triggers are used to configure automated actions for incoming requests or records that fulfill certain preconfigured criteria.
You can automate several processes, such as sending customized email notifications, creating a new request based on resource field information, or setting up integration with third-party applications.
Role Required: SDAdmin or HelpDeskConfig
To configure request custom triggers, go to Admin > Automation > Custom Triggers > Requests.
Triggering the Defined Workflow
When an incoming request matches certain conditions, you can configure specific actions to be performed automatically. The conditions refer to the values that the request fields must contain when the request is created, edited, deleted permanently, or moved to trash.
In addition to the specified events, custom triggers can also be executed when:
-
A request is duplicated.
-
An incident request is converted to a service request or vice-versa.
- A request is generated via maintenance.
Custom triggers are categorized into groups.
Create New Group
-
Click Trigger Group.
-
Provide a Name and Description for the group.
-
Click Save or Save and Add New.
Configuring Custom Triggers
-
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: Add a short note on the need for the trigger.
-
Execute on actions: Choose when or at which events the trigger must be executed during the request life cycle: created, edited, deleted permanently, or moved to trash.
-
Execute during: Choose the execution time window for the trigger - any time, within operational hours, or outside operational hours.
- Cascade Execution: Choose the sequence in which the triggers must be executed:
-
Apply the next trigger configured in the list view.
-
Skip the remaining triggers in the current trigger group and execute the next trigger group, if any.
-
Skip all remaining triggers across all trigger groups.
-
When Request arrives: Define conditions of the incoming request. You can choose to apply any conditions based on criteria, apply conditions based on custom functions, and apply no conditions.
-
Apply conditions based on criteria - Choose the criteria by using the drop-down lists. You can configure up to 100 criteria using the AND/OR operations.
-
For a given criteria, you can configure multiple sub-criteria.
-
For fields such as Requester, Technician, Groups, you can configure criteria for dynamic input using placeholders, such as $All my groups and $Logged in user.
- For multi-select fields such as Status, Created by, and Department, you can configure criteria based on their sub-field values by clicking >
-
Apply conditions using custom functions - Define criteria using request custom functions.
-
Apply no condition - The custom trigger will be applied to all incoming requests.
If there are no conditions configured, the trigger will be executed only the resulting action will modify or change the request field values. If there will be no change to the request field values if the trigger were to be executed, the configured trigger will not be executed.
- Execute Rule when the criteria is met: This option is available only if the trigger must be applied on Edited requests. Choose whether the trigger must be applied only for the first time or every time the criteria is met by incoming requests.
- Actions: Configure the actions to be performed when a request satisfies the specified condition. You can trigger the following actions:
-
Apply If-If action or If-Else actions
- Click Save.
-
![requests custom triggers 2](https://www.manageengine.com/uk/products/service-desk-msp/help/adminguide/configurations/helpdesk/images/requests-custom-triggers-2.png)
Configuring Custom Actions
Custom triggers are configured to execute various actions for requests that fulfill specific incoming criteria.
In ServiceDesk Plus MSP, you can choose from 7 custom actions for your custom triggers, as follows:
Some examples of the notifications you can send are as follows:
-
Notify technicians about high priority or important requests right when the requests are created.
-
Notify requesters when their tickets are assigned to technicians.
To configure a notification, go to Select Custom Action > Notification Action.
![requests custom triggers 3](https://www.manageengine.com/uk/products/service-desk-msp/help/adminguide/configurations/helpdesk/images/requests-custom-triggers-3.png)
Choose a template and select users you want to notify by using variables, placeholders, or 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
-
$Current_Level_All_Approvers
-
$Current_Level_Approvers_of_Approved_Approvals
-
$Current_Level_Approvers_of_Pending_Approvals
-
$Current_Level_Approvers_of_Denied_Approvals
-
$Preceding_Levels_All_Approvers
-
$Preceding_Levels_Approvers_of_Pending_Approvals
-
$Preceding_Levels_Approvers_of_Approved_Approvals
-
$Preceding_Levels_Approvers_of_Denied_Approvals
-
$Succeeding_Levels_All_Approvers
-
$Email ids to be Notified
You can also use additional fields as variables.
Click New to create a new template.
Provide a template name and select the Mode: SMS/Email.
Provide a relevant subject.
Note that attachments are not allowed for the SMS mode. For emails, the attachment size is 10MB by default. This can be modified by your system admin.
Custom Functions
Custom functions allow you to manipulate data in ServiceDesk Plus MSP and other external applications. requestObj and context are the arguments supported in custom functions.
To configure custom functions as a custom action
-
Under Actions, select Custom Action > Custom Function.
-
Select the custom function to be executed or click New to create a function instantly.
-
Click Save.
To learn how to write custom functions, visit this page.
Custom Scripts
Custom scripts allow users to modify the application's behavior and UI. In a script file, you can program the actions to be performed.
By default, the following request operations are supported:
Follow the steps described in the document given below to program the required actions effectively.
-
Writing Custom Script files (A sample Python file)
Execute Class
In a class file, you can program the actions to be performed.
-
Place the class file under [SDP MSP_Home]/integration/lib/ directory.
-
Under Actions, select Custom Action > Execute Class.
-
Copy the class file name and paste it in the text box.
-
Click Save.
Webhook
A webhook allows the user to call an external URL or API to facilitate communication between ServiceDesk Plus MSP and any third-party applications.
You can configure webhooks under Admin > Developer Space > Webhooks.
After creating webhooks, you can select a webhook as the action for an automation.
-
Under Actions, select Custom Actions > Webhooks.
-
Select the webhook to be executed.
-
Click Save.
If-If Actions
The If-If action allows you to bundle multiple custom actions and execute them when the specified criteria is met.
You can configure only one If-If action for a custom trigger.
Scenario:
If the category of an incoming request is Server, notify the site in-charge about the issue via email. If the category is Quality Issue, you can configure a webhook to send notification to a channel in Slack.
How Does If-If Action Work?
The blocks in the If-If action are evaluated sequentially and executed based on criteria match.
You can add up to 10 If blocks and configure up to 5 actions in each If block.
You can configure notifications, custom functions, custom scripts, or webhooks as custom actions.
You cannot configure custom functions and custom scripts within the same block.
Configure If-If Action
-
Under Actions, click Select Custom Action > If-If.
-
Configure the criteria using the drop-down lists. You can create up to 10 criteria using AND/OR combinations.
-
Configure actions using the available options: Notification Action, Custom Function, Execute Script, or Webhook.
-
Click Add If block to add another block or click Update.
If -Else Actions
You can use the If-Else action to configure actions when the criteria is met and when it is not met.
You can configure only one If-Else action for a custom trigger.
Scenario: When a request is created with Employee Onboarding template, send an email to the HR department to initiate onboarding process.
-
If the job title of the employee is Member Technical Staff, use custom script to create an account in AD and add them to Zylker group.
-
Else, use a custom script to create an account in AD and add the employee to Zylker Trainee group.
How Does If-Else Action Work?
The blocks in If-Else action are validated sequentially.
If-Else action has three types of blocks: If, Else-If, and Else.
If block* |
|
Else-If block |
|
Else block* |
|
* Mandatory blocks
Configure If-Else Actions
-
Under Actions, click Select Custom Action > If-Else.
-
In the If block, configure the criteria using the drop-down list. You can add up to 10 criteria using AND/OR combinations.
-
Configure actions using the available options: Notification Action, Custom Function, Execute Script, or Webhook. You can configure up to 5 actions in each block.
-
To add an Else-If block, click Add Condition and configure criteria and actions.
- After defining If and Else-If blocks, configure an action in the Else block and click Update.