Business Rules for Custom Module

Business rules are used to automate certain actions for incoming records that fulfill certain criteria. Some of the actions that can be automated using business rules include employee onboarding, leave request approval, assigning groups or technicians, auto-update status, and priority.
 

Business rules are common for the entire organization. They are not site-specific.

 

Role Required: SDAdmin

 

Business rules are categorized and organized under rule groups. You can configure a rule group for all related groups. Rule groups are incredibly useful because you can restrict or apply only specific rules for an incoming record.

 

To create a new group, click Rule Group. On the displayed page, provide a name and description and click Add.

 

 

 

Configuring a Business Rule

 

After creating a rule group, create a business rule.

 

Hover over the rule group and click Add Rule. Fill out the displayed form using the following pointers.

 

Use the toggle button to enable the business rule. You can disable it when you want to pause its execution later.

 

Fields

Explanation

Rule name and Description

 

 

 

 

 

 

Provide an appropriate rule name, along with a brief and clear note on how the business can be used.

 

Execute on actions

 

Choose when to execute the rule in the record life cycle:

 

  • Created

  • Edited

  • Deleted Permanently

  • Moved to trash

If you choose Edited, you will have the option to choose whether to execute the rule every single time or only the first time, when you configure the Condition.
If you choose Deleted Permanently and configure Abort process execution as the action, the deleted record will be retained in trash.
The Moved to Trash feature will be available only when the Trash option is enabled on the custom module details page within the Admin section.

Cascade Execution

 

Choose the order of rule execution:

 

  • Execute next rule

  • Skip remaining rules in this group

  • Skip remaining rules across all groups

Cascade execution establishes an order in which the rules are executed. This is helpful when the result of one rule execution is the input for the following rule. Cascade execution can be incredibly useful for contexts that require multiple levels of approval or the evaluation of various criteria for a specific decision.

Condition

 

Define the condition for the incoming record.

 

Apply conditions based on criteria

 

Under this selection, you can choose the required criteria from the drop-down list. Various criteria from across modules can be configured.

 

You can configure a maximum of 100 criteria for each rule.

 

Moreover, for each criteria, you can configure up to 10 additional nested criteria-conditions using the AND/OR logical operators.

 

Apply conditions using custom function

 

Under this selection, you can configure your own custom function to define the criteria for incoming records.

 

Apply no condition

 

Under this selection, the business rule will be applied to all incoming records.


Actions  

 

Choose whether to Abort process execution or Execute custom actions.

 

When you choose Abort process execution, you can add the required error message to be displayed to the user and click Save.

 

When you choose Execute custom actions, you can select from the following three custom actions, which will be executed when the incoming custom record fulfills the configured criteria.

 


Executing Custom Actions

 

Business rules are configured to execute various actions for records that fulfill specific incoming criteria.

 

In ServiceDesk Plus, you can configure five custom actions for your business rules, as follows:

 

Field Update

 

This is one of the easiest and simplest of actions that can be accomplished through a business rule. It merely involves modifying the field of an incoming record.

 

Modifying the field may lead to various other actions due to associated configurations. Moreover, in one Field Update action, you can modify up to 15 fields.
 

When you select Override field values with rule values, the business rule configurations take precedence over the record field values. That is, if the record contains some preset values for fields that will be modified if the configured business rule were to be executed, then the business rule values will be overwritten and the original values deleted. Learn more.


Custom Function

 

For actions that cannot be performed out of the box, you can create custom functions by using the application data, along with data from external applications to perform actions required in your environment.  Learn more.

 

Some of the actions that you can use custom functions are for creating/closing a custom module record and associating with changes/problems.

 

The custom functions in ServiceDesk Plus are built on Deluge, Zoho's proprietary scripting language.

 

Follow these steps to create a new custom function:
 

On the left pane, besides the various code snippets, several built-in functions are available for various actions, such as sending emails and notifying stakeholders. 
 

 

Execute Script

Scripts, like custom functions, are required to perform actions that are not available out of the box. Scripts are created by using the application data, along with data from external applications to perform actions required in your environment.
 

However, unlike custom functions, you cannot create scripts within the application. You will have to use an external executor file to configure scripts for your specific requirement.
 

Under custom actions, you can configure either Execute Script or Custom Functions. You cannot configure both these actions together.


If-If
 

The If-If custom action allows you to define actions when multiple conditions are met. You can configure up to 10 conditional actions using the If-If clause.
 

For each fulfilled If condition, you can configure Field Update, Custom Functions, and Execute Script.
 

To configure the If-If condition:
 

 

 

If-Else

The If-Else clause allows you to define actions when a set of conditions are met and also when they are NOT met.
 

The If conditions configurations work exactly as the If-If condition. You can configure up to 10 conditions using the OR and AND operator. The Else condition is used when the configured If conditions are not met. Then, you can define the Else custom actions such as Field Update, Custom Actions, and Execute Scripts.
 

These actions for unmet conditions can be based on newer conditions. You can again configure up to eight conditions for the Else-If condition.
 

To configure the If-Else condition:
 

Then, click Select Custom Action to select the required custom actions as mentioned earlier. Learn more.