Deluge Scripting - Summary

 

Custom Function Type Input Parameters Description Return Type Description

Business Rule Actions

a. requestObj (Map)

requestObj contains the details of the request on which the business rule acts.

Sample Structure

{
“subject” : “New Issue”,
“priority” : {
“name” : “High”
},
...}

Map

requestObj is expected to be returned from the function. You can make changes to the

requestObj values and they will be updated in the request.

b. context (Map)

context contains the following details:

a. instance – Portal in which the custom function is executed.

b. userInfo – Logged in user details.

c. initialObj – Present only if the business rule is executed upon request edit; it contains the initial request.

d. modifiedFields - Present only if the business rule is executed upon request edit; it contains the fields whose values are changed.

Sample Structure

{
“instance” : “itdesk”,
“userInfo” : {“userInfo” : {
“email_id” :
“sampleusername@manageengine.com”,
“type” : “requester/technician”,

Id>”
},
“intialObj” : {
“subject” : “New Issue”,
“priority” : {
“name” : “Low”
},
“modifiedField : [“priority”]
}

Business Rules Conditions

a. requestObj (Map)

b. context (Map)

The input parameters function the same way they do in the custom functions of business rule actions. For more details, click here.

Boolean

The business rule action will be executed if the custom function returns ‘true’.

Request Trigger and Life Cycle Actions

a. requestObj (Map)

requestObj contains the details of the request on which the trigger acts.

Sample Structure

{
“subject” : “New Issue”,
“priority” : {
“name” : “High”
},
...
}

Void

Should return nothing.

b. context (Map)

context contains the following details:

  • instance – Portal in which the custom function is executed.
  • userInfo – Logged in user details

Sample Structure

{
“instance” : “itdesk”,
“userInfo” : {
“email_id” :
“sampleusername@manageengine.com”,
“type” : “requester/technician”,
“id” : “<servicedesk plus user
}
}

Change Trigger Actions

a. changeObj (Map)

changeObj contains the details of the change request on which the trigger acts.

Sample Structure

{
“title” : “New Change”,
“status” : {
“name” : “Requested”
}
}

Void

Should return nothing.

 

b. context (Map)

context contains the following details:

  1. instance – Portal in which the custom function is executed.
  2. userInfo – Logged in user details.

Sample Structure

{
“instance” : “itdesk”, “userInfo” : {
“email_id” : “sampleusername@manageengine.com”,
“type” : “requester/technician”, “id” : “<servicedesk plus user
Id>”
}
}

Scheduled Functions

context (Map)

context contains instance, the portal in which the custom function is execu:

  • instance - Portal in which the custom function is executed.

Sample Structure

{
“instance” : “itdesk”
}

Map

The custom function should return a Map value.

For example, return Map();

Callback functions

User-defined parameters

You can define the parameters in the custom function.

Map

The custom function should return a Map value.

For example, return Map();