Workflows

Workflows

Workflows help you define a directional pathway to process the requests through its life cycle. You can execute workflows for requests, problems, changes, and releases, and assets.

Workflows 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, Releases, and Assets
SDAdmin
 

Configure Custom Functions for Workflows

  1. Go to Setup > Developer Space > Custom Functions.
  2. In the module drop-down, select the relevant operation based on the module:
    1. To configure workflow actions in Requests - select Abort Timer Conditions (or) Workflow Actions
    2. To configure workflow conditions/actions in Problems - select Abort Timer Conditions (or) Workflow Conditions (or) Workflow Actions
    3. To configure workflow conditions/actions in Changes - select Business Rule Conditions (or) Abort Timer Conditions (or) Workflow Conditions (or) Workflow Actions
    4. To configure workflow conditions in Releases - select Workflow (or) Timer Conditions
    5. To configure workflow conditions/actions in Assets - select Workflow Conditions (or) Actions
  3. Click New Custom Function. You can alternately write the custom function while creating/editing a timer.
  4. 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.
  1. Requests - 'requestObj' and 'context'
  2. Problems - 'problemObj' and 'context'
  3. Changes - ' changeObj ' and 'context'
  4. Releases - 'releaseObj' and 'context'
  5. Assets - 'assetObj' and 'context'

'[module]Obj' - Stores the details of the request on which the workflow must act. 

'context' - Stores the current instance and the logged-in user details. 

Info
If the custom function is configured for a module sub-entity, the respective sub-entity object will be passed in the parameter. 
*mandatory fields
  1. After compiling the custom function, click Save or Save & Execute Script.

Points to remember:

Ensure custom function returns "Boolean" value. Actions that you configure in the timer will be executed if the custom function returns 'true'.
Info
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.  

Test Execution of Scripts

After writing the custom function, you can test it by following the steps given below:
  1. Click Save & Execute Script.
  2. Choose a sample record from the list of records displayed and click Next.
  3. 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.
  4. Click Execute.
Info
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.
  1. info requestObj;
  2. 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

    • Workflows

      Workflows help you define a directional pathway to process the requests through its life cycle. You can add various nodes and automate actions based on the request's stage/status. Supported modules: Requests, Problems, Changes, Releases, Assets ...
    • Zoho Circuit Integration

      ServiceDesk Plus MSP Cloud integrates with Zoho Circuit to help you automate complex workflows by systematically defining and organizing a sequence of tasks. You can use functional tasks such as SSH Task, DB Task, AD Task, Task Engine, and PowerShell ...
    • Overview

      Deluge, or Data Enriched Language for the Universal Grid Environment is Zoho's proprietary scripting language bundled with ServiceDesk Plus MSP Cloud. It is a high-level language that helps non-programmers code without any training. Unlike ...
    • Asset Workflow Editor

      The Workflow Editor enables you to build a directional pathway for the asset to follow through its life cycle. The workflow editor is provided with an expandable, scrollable canvas for creating workflow diagrams and a collapsible stencil panel. You ...
    • 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 ...