Field and Form Rules for Request Templates
This document guides you through the process of defining rules that can be executed on a Request form. Field and form rules are executed during the following conditions: after a request form is loaded, when some field in the form is changed and before a request form is submitted. The rules can be disabled or enabled, wherein the disabled rules will not be applied.
Types of Events Supported in Field & Form Rules
The following three types of events are supported:
On Form Load: This allows the rules to be executed when the request form is loaded. The rules defined on this event should contain at least one executable action. The actions will be executed after checking criteria; if no criteria is defined, the actions will be executed directly.
On Field Change: This allows the rules to be executed, when there is a change in the field value. The rules defined on this event should contain at least one executable action. The actions will be executed after checking criteria; if no criteria is defined, the actions will be executed directly. The rule will be applied on change of the field value mentioned in the rule.
On Form Submit: This allows the rules to be executed on submission of the request form. Here, "Execute Script" is the only action allowed for the event. The rules defined on this event should contain a valid script. The script will be executed after checking criteria; if no criteria is defined, the script will be executed directly.
Types of Users
The rules can be applied to Requesters or Technicians or All users. However, the rules that are applied to Requesters only will not be applied to Technicians, and vice versa.
Execution of Rules
The rules can be executed on creating a new request, or on editing an existing request, or on both of the operations.
Types of Actions Supported in Field & Form Rules
Show Fields : This action shows the fields in the request form, on which the action is applied.
Hide Fields : This action hides the fields in the request form, on which the action is applied.
Enable Fields : This action enables the fields in the request form, on which the action is applied. As a result, the user will be able to edit those fields.
Disable Fields : This action disables the fields in the request form, on which the action is applied. As a result, the user will not be able to edit those fields.
Mandate Fields : This action makes the fields mandatory in the request form, on which the action is applied. As a result, the user will not be able to submit the form without filling values for those fields.
Non-Mandate Fields : This action removes the mandatory properties of the fields in the request form, on which the action is applied. As a result, the user will be able to submit form without filling values for those fields.
Execute Script : This action executes the script in the request form. The script should be a valid JavaScript code; otherwise it will not be executed. Some methods are supported as default methods in script execution, for example, to hide Category and Level fields you can call the below method with an array of fields as: $CS.hideField(["CATEGORY","LEVEL"]);
Copying Rules To Another Template
You can copy one or more rules from one template to another, using copy rule action provided in Actions menu. While copying the rule, if a particular field does not exists in the other request template, then that field will not be copied. Also, if for a rule, no criterion/action can be copied, then that rule will not be copied.
Removing Fields from Request Form
Removing fields from a template automatically removes those fields from the rules defined in that template as well. After deleting the fields, if for some rule no criterion/action is left out, then that rule will also be deleted.
Operations performed on Rules
Creating a New Rule
-
Log in to ServiceDesk Plus application using the user name and password of an Admin user.
-
Click the Admin tab in the header pane.
-
From the Helpdesk menu click the Incident Templates icon.
-
Click the Default Request under the Incident Template List.
-
Access the Field and Form Rules tab. The Rules wizard is shown. From here, you can create a rule for any of the below events:
-
On Form Load
-
On Field Change
-
On Form Submit