Associate a Request in ServiceDesk

Table of ContentsDown

Overview

The associate SDPOD integration task in Zoho Creator can be used to associate worklogs, notes and resolutions to a request in ServiceDesk Plus OnDemand. For example, in the request to book a conference hall, you can associate worklogs, notes and resolution to add more details like progress of the request, status, etc. The associate task is initiated in Zoho Creator by adding code to a form, which upon submission, associates the declared module to the request in ServiceDesk Plus OnDemand.

Syntax

<response>= zoho.sdpod.associate(moduleName,requestID, fieldsMap);

where,
<response> is the map variable returned as response. It contains the details of the module associated with the request.
moduleName refers to the module that needs to be associated with the request. Worklogs, Notes and Resolution are the supported modules that can be associated with a request.
<requestID> refers to the ID of the request that needs to be associated with the module.
<params> is the map variable that holds the key,value pairs. The map key is the label name as specified in the ManageEngine ServiceDesk Plus Requests module and the map value is the field value as submitted in the ZC form.

Example - Using script-builder

In this example, we will add Worklogs, Resolution and Notes to an existing request in ServiceDesk Plus OnDemand. Lets assume we have a request to book a conference hall. Now the host needs to add more details to the request like logs, notes and resolution. Using script-builder we will create the equivalent script. Upon submission of the form, the code gets executed and the respective module gets associated with the request in ServiceDesk Plus OnDemand based on the given record ID.

  1. Go to the Zoho Creator form containing the request values
  2. Click on Workflow to open the scriptbuilder. Go to the On Add - On Success section.
  3. Drag-and-drop the "call function" task under "Miscellaneous" tasks in Zoho Creator to select the request values.
  4. Select Integration tasks.
  5. Set "Select Service" as SDPOnDemand.
  6. Set "Select Function" as Associate Module To Request.
  7. Set "Module Name" as Worklogs, Resolution or Notes.
  8. Set "ID" of the record that needs to be associated with these modules.
  9. Click on "New Map" to add the key-value pairs.
  10. Select the following key-value pairs and click on Done.

    For Worklogs, insert the following key-value pairs:

    "TECHNICIAN" : Technician, "TECHNICIANEMAIL" : Email, "WORKHOURS" : WorkHours, "WORKMINUTES" : WokMinutes, "COST": Cost, "DESCRIPTION" : Description

    For Notes, insert the following key-value pairs:

    "NOTESTEXT" : Text, "ISPUBLIC" : IsPublic, "NOTIFYTECH" : Notify

    For Resolution, insert the following key-value pairs:

    "RESOLUTION" : Resolution
  11. Click on Done to insert the call function task.

Upon submission of the form, the respective module gets associated with the request in ManageEngine ServiceDesk Plus

Example - Using free-flow scripting

Instead of using the script-builder you can also use the free-flow scripting to directly insert the code in the editor box.

  1. Go to the Zoho Creator form containing the request values
  2. Click on Workflow to open the scriptbuilder. Go to the On Add - On Success section and navigate to Free-flow Scripting.
  3. To associate worklogs, add the following code in the editor box and click on "Save"

    // declare the map variable to hold key-value pairs
    params = {"TECHNICIAN" : input.Technician, "TECHNICIANEMAIL" : input.Email, "WORKHOURS" : input.WorkHours, "WORKMINUTES" : input.WorkMinutes, "COST": input.Cost, "DESCRIPTION" : input.Description};

    // add worklogs to the request by executing the syntax
    response = zoho.sdpod.associate("worklogs", 1000, params);

  4. To associate notes, add the following code in the editor box and click on "Save"

    // declare the map variable to hold key-value pairs
    params = {"NOTESTEXT" : input.Text, "ISPUBLIC" : input.IsPublic, "NOTIFYTECH" : input.Notify};;

    // add notes to the request by executing the syntax
    response = zoho.sdpod.associate("notes", 1000, params);

  5. To associate a resolution, add the following code in the editor box and click on "Save"

    // declare the map variable to hold key-value pairs
    params = {"RESOLUTION" : input.Resolution};

    // add resolution to the request by executing the syntax
    response = zoho.sdpod.associate("resolution", 1000, params);

    where,
    params contains the key-value pairs. The keys refer to the label names in ServiceDesk Plus OnDemand and the values refer to the values of Zoho Creator field values. For example, "TECHNICIAN" is the label name in ServiceDesk and input.Technician is the value entered in the "Technician" field of ZC form.
    response is the map variable returned as response. It contains the details of the module that gets associated with the request.
    worklogs, notes and resolution stand for the module names "Worklogs", "Notes" and "Resolution" respectively in ServiceDesk Plus OnDemand.
    1000 stands for the ID of the request that needs to be associated with the module. Replace it with the actual ID of the record that needs to be associated with the module.

  6. Upon submission of the form, the respective module gets associated with the request in ServiceDesk Plus OnDemand.
  7. In this example, the sample response for adding worklogs will contain the following details:
    response = { "status": "Success", "WORKLOGID": "2000000124193"};
  8. The sample response for adding notes will contain the following details:
    response = { "status": "Success", "NOTESID": "2000000124159", "NOTESDATE": "1320668123937"};
  9. The sample response for adding a resolution will contain the following details:
    response = { "status": "Success", "RESOLUTION" : "Resolution" };
  10. If for some reason, the execution fails, the response will be of the following format:
    response = {"status" : "Failure" , "message" : "<error message>"};

Share this post : FacebookTwitter