Timers allow you to plan automated actions within a specific time frame and execute time-delayed actions. You can execute timers for requests, problems, changes, and releases.
Timers consist of two main parts: Conditions and Actions. You can use custom functions to configure both conditions and actions.
Supported Modules
| Role Required
|
Requests
| SDAdmin, SDSiteAdmin, HelpDeskConfig
|
Problems, Changes, and Releases
| SDAdmin
|
- Go to Setup > Developer Space > Custom Functions.
- In the module drop-down, select the relevant operation:
- To configure timer conditions - select Workflow (or) Timer Conditions
- To configure conditions for aborting timers - select Business Rule (or) Abort Timer Conditions (or) Workflow Actions
- To configure timer action - Trigger (or) Life Cycle (or) Actions
- Click New Custom Function. You can alternately write the custom function while creating/editing a timer.
- Fill out the necessary information as described in the below:
Field
| Description
|
Custom Function Name*
| Provide a unique name for the custom function.
|
Description
| Describe the objective and usage of the custom function.
|
Applies to
| Choose the sub-entities within the module where the custom function is applied.
|
Deluge Script Editor
| Compile the custom function in the Deluge Script Editor using a simple drag-and-drop motion. To learn more about Deluge and how to write custom functions, click here.
Depending on the module selected, the following arguments will be passed in the custom function.
- Requests - 'requestObj' and 'context'
- Problems - 'problemObj' and 'context'
- Changes - ' changeObj ' and 'context'
- Releases - 'releaseObj' and 'context'
'[module]Obj' - Stores the details of the request on which the timer must act.
'context' - Stores the current instance and the logged-in user details.
 If the custom function is configured for a module sub-entity, the respective sub-entity object will be passed in the parameter. |
*mandatory fields
- After compiling the custom function, click Save or Save & Execute Script.
Points to remember:
Timer Condition: Ensure custom function returns "Boolean" value. Actions that you configure in the timer will be executed if the custom function returns 'true'.
If the custom function in the timer is configured to execute upon request edit, then the context object will additionally contain 'initialObj' and 'modifiedFields'. 'initialObj' will store the original request values and 'modifiedFields' will store the fields whose values are modified.
Timer Action: Ensure custom function returns "void" value.
Test Execution of Scripts
After writing the custom function, you can test it by following the steps given below:
- Click Save & Execute Script.
- Choose a sample record from the list of records displayed and click Next.
- The data that will be passed to the custom function will be displayed under the parameter '[module]Obj'. Optionally, you can modify the '[moduleObj' values.
- Click Execute.
If you make any API calls by using zoho.sdp.invokeurl or invokeurl while testing the custom function, the API will be invoked. Make sure you don't invoke an API that might result in unintended consequences.
Debugging Tip
When you test a custom function, you can debug the code and print the output by using a statement called info. For example, to understand the structure of requestObj and context, you can simply run the following script and study the response.
- info requestObj;
- info context;
For a quick summary of how to use custom functions across different features in ServiceDesk Plus MSP Cloud,
visit this link.
Related Articles
Work Log Timer
Work Log timer allows you to track the time spent by technicians in resolving a request or in performing an assigned task within a request. It also displays the number of technicians working on a request. Setting Work Log Timer Go to Requests and ...
Custom Actions
Custom actions refer to user defined actions that can be performed on different entities across modules. For a custom action to be performed on an entity, it should be used with automation rules, subject to the availability of support. The following ...
Add Work Logs in Requests
Work Logs show records of time spent by the technician on a request and helps SDAdmins monitor the technicians' activities. In Work Logs, technicians can detail their work, specify the time it took to address the request, and also mention any ...
Triggers
Triggers execute automated actions when certain events occur in the service desk. Triggers are useful for executing condition-based actions across modules or in third-party applications. Use Case: Triggers automate several processes, such as sending ...
Incident Workflow Editor
The Workflow Editor enables you to build a directional pathway for the service request to follow through its life cycle. The workflow editor is provided with an expandable, scrollable canvas for creating workflow diagrams and a collapsible stencil ...