Change Ticket Custom Function Example in ServiceDesk Error

Change Ticket Custom Function Example in ServiceDesk Error

I receive the following error when trying to use the example program to change a ticket in ServiceDesk:
"Error at line : 17, 'TEXT' can not be cast to '[KEY-VALUE, TEXT, LIST]' for the function 'get'"

LINE 17:
status = result.get("status");

PROGRAM:
//Assigning value got from the Request fields to variables.These values can be used in constructing the JSON for creating the Change
requestID = requestObj.get("id");
createdTime = requestObj.get("created_time");
inputData = {"operation": {"details": {"title": "[REQ_ID-"+requestID+"] Change router software","stagename": "submission","statusname": "Requested For Information","priority": "high","description": "This is a Change request for a router software","scheduledstarttime": createdTime.get("display_value"),"servicesaffected": ["Email","CRM"]}}};
instanceJson = context.get("instance");
helpdeskID = instanceJson.get("id");
//Please update all the parameters like the ServerName , portnumber and Technician API key  based on your Environment. Make sure the technician has proper roles to access the Request and Change Modules
response = invokeurl
[
    url: "http://<SERVER>:<PORT>/sdpapi/change"
    type: POST
    parameters: {"INPUT_DATA":inputData,"TECHNICIAN_KEY":"<KEY>","format":"json","OPERATION_NAME":"ADD","PORTALID":helpdeskID}
];
info response;
operation = response.get("operation");
result = operation.get("result");
status = result.get("status");
//Messages to be printed in Request history
returnObj = Collection();
if("success".equalsIgnoreCase(result.get("status"))) {
    returnObj.insert("result":"success");
    returnObj.insert("message":"Change request created successfully");
} else {
    returnObj.insert("result":"failure");
    returnObj.insert("message":"Problem in creating change request");
}
return returnObj;

Any help is appreciated, thank you.

    Access your files securely from anywhere







                            Zoho Developer Community




                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                  • Ask the Experts





                                                            Manage your brands on social media



                                                                  Zoho TeamInbox Resources



                                                                      Zoho CRM Plus Resources

                                                                        Zoho Books Resources


                                                                          Zoho Subscriptions Resources

                                                                            Zoho Projects Resources


                                                                              Zoho Sprints Resources


                                                                                Qntrl Resources


                                                                                  Zoho Creator Resources



                                                                                      Zoho CRM Resources

                                                                                      • CRM Community Learning Series

                                                                                        CRM Community Learning Series


                                                                                      • Kaizen

                                                                                        Kaizen

                                                                                      • Functions

                                                                                        Functions

                                                                                      • Meetups

                                                                                        Meetups

                                                                                      • Kbase

                                                                                        Kbase

                                                                                      • Resources

                                                                                        Resources

                                                                                      • Digest

                                                                                        Digest

                                                                                      • CRM Marketplace

                                                                                        CRM Marketplace

                                                                                      • MVP Corner

                                                                                        MVP Corner









                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now


                                                                                            Zoho Show Resources

                                                                                              Zoho Writer

                                                                                              Get Started. Write Away!

                                                                                              Writer is a powerful online word processor, designed for collaborative work.

                                                                                                Zoho CRM コンテンツ



                                                                                                  Nederlandse Hulpbronnen


                                                                                                      ご検討中の方