2 Replies Latest reply on Jan 21, 2019 2:14 AM by philaries

    Service Desk Framework API, Service Desk Framework API

    philaries Rookie

      Hello,

      We have Service Desk 2018.3 and I'm trying to integrate into the FrameWork API. I have the document from Ivanti but struggling because I keep getting a 'Object not set to an instance of an object' and i'm not sure why, all the required form fields are populated.

      Here's an example below:

      GET: http://XXXX/ServiceDesk_UAT.Framework.Explicit/api/form?class_name=RequestManagement.Request&v=*&lifecycle_name=NewProcess171

      {
         "FormType": "Create",
         "Lifecycle": "NewProcess171",
         "IsConfirmationObject": false,
         "IsConfirmationOnLaunch": 0,
         "ClassName": "RequestManagement.Request",
         "Title": "Request",
         "Url": "class_name=RequestManagement.Request&lifecycle_name=NewProcess171",
         "HasCollections": false,
         "OkButtonText": "",
         "ApplyButtonText": "",
         "CancelButtonText": "",
         "FormItems": [   {
            "Label": "Request Details",
            "FullName": "GroupBox",
            "DataType": "Group",
            "IsTwoColumnGroup": false,
            "FormItems":       [
                        {
                  "FullName": "Description",
                  "DataType": "String",
                  "Value": null,
                  "Label": "Details: ",
                  "ShowHyperlink": false,
                  "Options":             {
                     "IsMultiline": true,
                     "MinimumRows": 0,
                     "MaxLength": -1,
                     "CustomValidators": []
                  }
               },
                        {
                  "FullName": "_ConfigItemRequested.Title",
                  "DataType": "String",
                  "Value": null,
                  "Label": "Summary:",
                  "ShowHyperlink": false,
                  "Options":             {
                     "IsReadOnly": true,
                     "MaxLength": 100,
                     "CustomValidators": []
                  }
               },
                        {
                  "FullName": "_ConfigItemRequested",
                  "DataType": "Object",
                  "Value": "",
                  "ClassName": "Config.ConfigItem",
                  "DisplayText": "",
                  "Label": "Service Item:",
                  "ShowHyperlink": false,
                  "Options":             {
                     "IsTriggerValueChanged": true,
                     "HasFilter": true,
                     "CustomValidators": []
                  }
               }
            ]
         }]
      }

      As you can see there are three formitems that need to be posted.

      POST: http://XXXX/ServiceDesk_UAT.Framework.Explicit/api/form?class_name=RequestManagement.Request&v=*&lifecycle_name=NewProcess171

      {
          "class_name":  "RequestManagement.Request",
          "formvalues":  [
                             {
                                 "Name":  "Description",
                                 "Value":  "test"
                             },
                             {
                                 "Name":  "_ConfigItemRequested.Title",
                                 "Value":  "Test"
                             },
                             {
                                 "Name":  "_ConfigItemRequested",
                                 "Value":  null
                             }
      ],
      "lifecycle_name":  "NewProcess17",
          "TotalCount":  1
          }

      I get the following back:

      {
         "Message": "Object reference not set to an instance of an object.",
         "ErrorCode": 1000,
         "ErrorData": {}
      }

      I'm not sure why i'm getting that message all form values are populated as far as I'm concerned? I've even tried populating _ConfigItemRequested with a valid GUID from config_item table.

      Any ideas anyone?

      Thanks