Deluge Script to show request attributes in Task Subject / Description from builds: 10600

Deluge Script to show request attributes in Task Subject / Description from builds: 10600

Requirement:
To show the request field values such as Request Type, Status etc., or the additional field values in the Task subject/description.

Use case:
When a task is triggered from a request, it should contain the request details (configured) in the Subject/Description of the task. This will enable to task technician to quickly view the request information in the task.

Please follow the below steps. 
Download the attached ZIP folder and unzip it.

STEP 1:
  1. Go to Admin > Task Custom Functions > Global function > New > Paste the content from the attachment  1. Global function_5.txt  and save it with a name.
  2. Update the URL and integration key in the script. 
    1. You can get the integration key under Admin > Integrations > Integration Key > New
    2. Please use the Technician API key with admin privilege, as there wont be any role related permission issues. 
    3. Update the Technician API key and Application URL in the global function.
    4. Make a note of the Global function number as highlighted below.


STEP 2: 
  1. Go to Admin > Task Custom Functions > Global function > New > Paste the content from the attachment  (3. global_function14.txt) and save it with a name. Modify the return type and the parameter as in the attached screenshot. (4. global_function14 configuration) and note down the Global function number as well.


STEP 3:
  1. Go to Admin > Task Custom Functions > Global function > New > Paste the content from the attachment  global_function15.txt
  2.  Replace the global function number with the Number which was noted in Step 2 in the first line and save it with a name.
  3. Modify the return type, parameter, and the global function name in the attached screenshot.(6. global_function15 configuration) and note down the Global function number from here as well.


STEP 4: 
  1. Go to Admin --> Task Custom Functions-->Custom Actions. Create a new function.
    1. Copy paste the script from the attachment (7. taskupdate_deluge.txt.)
    2. Modify the global functions in the script(Replace the global function in first like with global function noted in Step 1 and Global function noted in Step 3 in Line 26 and 28 Respectively)
    3. Refer to the attached screenshot. (8. taskupdate_deluge configuration)


STEP 5:
  1. Update the task template as shown below. There should be a space before and after the variable.
  2. If you need to add any additional field value in the task description make a note of the API field name of the value from Admin>>incident additional field.

  1. Configure Task custom trigger as in the attached screenshot. (10. Task Custom trigger configuration)


The Following script will only work when the request is created so please make sure the following tasks are added with the variables in the template workflow so when the request is raised and tasks are triggered with the values entered.


      • Related Articles

      • Query to show Request and associated task details

        PGSQL & MSSQL: SELECT wo.WORKORDERID AS "Request ID", aau.FIRST_NAME AS "Requester", wo.TITLE AS "Subject", pd.PRIORITYNAME AS "Priority", cd.CATEGORYNAME AS "Category", scd.NAME AS "Subcategory", icd.NAME AS "Item", ti.FIRST_NAME AS "Technician", ...
      • Query to show both task comments and worklog comments

        MSSQL: SELECT "taskdet"."TASKID" AS "Task ID", "taskdet"."TASKID" AS "Task ID", "wotask"."WORKORDERID" AS "RequestID", cd.CATEGORYNAME AS "Request Category",  "taskgroup"."QUEUENAME" AS "Group", "taskowner"."FIRST_NAME" AS "Owner", "taskdet"."TITLE" ...
      • Query report to show Open requests without open tasks

        PGSQL & MSSQL: SELECT wo.WORKORDERID AS "Ticket Number", pd.PRIORITYNAME AS "Priority", cd.CATEGORYNAME AS "Category", ti.FIRST_NAME AS "Technician", aau.FIRST_NAME AS "Requester", wotodesc.FULLDESCRIPTION AS "Description", std.STATUSNAME AS "Request ...
      • Query to show tasks created per template along with status

        Since Task template is not stored in Task details, we cannot show count based on task templates. However, we have tried to form a query with task subject considering that, when task templates are used, the subject are not altered.  SELECT ...
      • Query to view task details with account

        For Postgres and MS SQL SELECT org_name "Account", "taskmilestone"."PROJECTID" AS "Project id", "taskdet"."TASKID" AS "Task ID", "taskdet"."TITLE" AS "Title", "taskcreatedby"."FIRST_NAME" AS "Created By", "taskowner"."FIRST_NAME" AS "Owner", ...