Better error message for REST API endpoint (POST /rest/servicedeskapi/request), must include missing fields

XMLWordPrintable

    • 2
    • 2

      Current State:

      If your Request Forms doesn't contain any fields. Summary is hidden with default value and all other required fields are within the JSM Forms. Then creating a request with following payload:

      {
      "form": {
      "answers": {
      "1": {"choices": ["10001"]},
      "2": {"choices": ["10005"]}
      }
      },
       "requestTypeId": "23",
      "serviceDeskId": "2"
      }
      

      it fails with generic message:

      This request is invalid. Check that the request contains all the required parameters and that the parameters are valid..

      Here requestFieldValues parameter is always needed.

      So correct payload would be:

      {
      "form": {
      "answers": {
      "1": {"choices": ["10001"]},
      "2": {"choices": ["10005"]}
      }
      },
        "requestFieldValues": {
        },
       "requestTypeId": "23",
      "serviceDeskId": "2"
      }
      

      Proposed Future State:

      Provide better error messages indication which field or parameter is missing.

       

      Alternative (e.g. Third Party Plugin):

      xx

              Assignee:
              Unassigned
              Reporter:
              Alim A. (Inactive)
              Votes:
              9 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: