Make the worklog description mandatory (Applicable only till 10536)

Make the worklog description mandatory (Applicable only till 10536)

The below script mandates the worklog description. 

1. Open a notepad.
2. Paste the below script and save as CustomScripts.js  under ManageEngine\ServiceDeskPlus-MSP/custom/scripts folder (If you already have any scripts under existing CustomScripts.js, please take a backup)
3. Please clear the browser cache once and then try to add a worklog.


************** Mandate Description **************


jQuery(document).on('click',"#addWorkLogButton",function(){
    var fields = ["description"];
    var isMandate = false;
    for(var i=0;i<fields.length;i++){
      var fld_val;
      if(fields[i]=="description")
      {
        fld_val = jQuery("textarea[name='"+fields[i]+"']").val();
      }
      else{
        fld_val = jQuery("[name='"+fields[i]+"']").val();
      }
      if(fld_val == "" || fld_val == "null"){
        isMandate = true;
      }
    }
    if(isMandate){
      alert("fill worklog and description");
      return false;
    }
    return true;
  }); 

          • Related Articles

          • Mandate Fields in Worklog

            The below scrips mandates the fields in worklog.  1. Open a notepad 2. Paste the below scrips and save as CustomScripts.js  under <SDP-home>/custom/scripts folder (If you already have any scrips under existing CustomScripts.js, please take a backup) ...
          • 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 to show Last added worklog of a ticket _MSSQL

            MSSQL: SELECT wo.WORKORDERID AS "Ticket Number", pd.PRIORITYNAME AS "Priority", cd.CATEGORYNAME AS "Category", qd.QUEUENAME AS "Group", ti.FIRST_NAME AS "Technician", aau.FIRST_NAME AS "Requester", Wo.title "Subject", wotodesc.FULLDESCRIPTION AS ...
          • How to add total_time_spent in worklog using API

            Please use milli-seconds as value to the attribute URL:  <URL>/api/v3/worklog?OPERATION_NAME=add&TECHNICIAN_KEY=XXXXXXXXXXXXX JSON:  input_date={ "worklog": { "request": { "id": "6" }, "description": "Adding a worklog", "technician": { "name": ...
          • Request aging with recent worklog comments

            MSSQL: SELECT wo.WORKORDERID AS "Request ID", CASE WHEN (wo.is_catalog_template) = 'false' THEN 'Incident' ELSE 'Service Request' END "Request Type",dpt.DEPTNAME AS "Department",pd.PRIORITYNAME AS "Priority", wo.TITLE AS "Subject",wodm.Dependsonid ...