Close a Request in ServiceDesk

Table of ContentsDown

Overview

The close SDPOD integration task in Zoho Creator can be used to close an existing request in ServiceDesk Plus OnDemand. For example, the request to book a conference hall can be closed once it is completed. The close request task is initiated in Zoho Creator by adding code to the form containing the request values, which upon submission, closes the request in ServiceDesk Plus OnDemand.

Syntax

<response>= zoho.sdpod.closeRequest(requestID, params);

where,
<response> is the map variable returned as response. It contains the details of the request that needs to be closed.
<requestID> refers to the ID of the request that needs to be closed.
<params> is the map variable that holds the key,value pairs. The map key is the label name as specified in the ServiceDesk Plus OnDemand 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 close an existing request in ServiceDesk Plus OnDemand. Lets assume we have a request to book a conference hall. Now the host needs to close the request after its completion. Using script-builder we will create the equivalent script. Upon submission of the form, the code gets executed and the request in ServiceDesk Plus OnDemand gets closed 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 Edit - 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 Close Request.
      7. Set "ID" of the record that needs to be closed.
      8. Click on "New Map" to add the key-value pairs.
      9. Select the following key-value pairs and click on Done.
        "CLOSEACCEPTED" : input.Status, "CLOSECOMMENT" : input.Comments

        Note

        • The "CLOSEACCEPTED" param will accept only YES/NO values.
      10. Click on Done to insert the call function task.


Upon submission of the form, the request gets closed in ServiceDesk Plus OnDemand

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 Edit - On Success section and navigate to Free-flow Scripting.
    3. Now add the following code in the editor box and click on "Save"

      // declare the map variable to hold key-value pairs
      params = {"CLOSEACCEPTED" : input.Status, "CLOSECOMMENT" : input.Comments};;

      // close request by executing the syntax
      response = zoho.sdpod.replyRequest(1000, params);

      where,
      params contains the key-value pairs. The keys refer to the label names in ManageEngine ServiceDesk Plus and the values refer to the values of Zoho Creator field values. For example, "CLOSEACCEPTED" is the label name in ServiceDesk and input.Status is the value entered in the "Status" field of ZC form.
      response is the map variable returned as response. It contains the details of the closing request.

      Note

      • The "CLOSEACCEPTED" param will accept only YES/NO values.
    4. 1000 stands for the ID of the request that needs to be closed. Replace it with the actual ID of the record that you need to close.
    5. Upon submission of the form, the request gets closed in ServiceDesk Plus OnDemand
    6. In this example, successful execution of the syntax will yield the following response:
      response = {"status": "Success", "WORKORDERID": "1000", "CLOSEACCEPTED": "Yes", "CLOSECOMMENT": "Request Closed"}
    7. 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