The JSM REST API allows the request creation with RequestIds not associated with the ServiceDeskId

XMLWordPrintable

    • 3
    • Severity 3 - Minor
    • 9

      Summary

      The JSM REST API allows the user to create a request, mixing seviceDeskId and requestTypeId that do not match. Additionally, the setting from the original requestTypeId may get reset on the process.

      Steps to Reproduce

      1. Create two JSM projects: Project Alpha and Project Beta
      2. Create one request type in each project. Make sure that they use the same Issue Type. Ex: IT Help
      3. Create a butch of custom fields.
      4. Add the custom fields to the issue type screen on Project Alpha.
      5. Add the custom fields to the request type screen on Project Alpha.
      6. Your settings should look similar to
          Project Alpha Project Beta
        Service Desk Id 1 10
        Request Type Id 2 20
      7. Using the JSM Rest API, create a request with the following payload. :
        {
            "requestFieldValues": {
                "description": "description ",
                "summary": "Summary"
            },
            "requestTypeId": "20",
            "serviceDeskId": "1"
        }

        The call should have the serviceDeskId of Project Alpha, but the requestTypeId of Project Beta.

      Expected Results

      The API request will fail with the message: "requestTypeId of 20 is not valid for serviceDeskId 1".

      Actual Results

      1. The request will be created on the Beta Project with a "No Match" Request Type.
      2. The fields on the Project Alpha Request Type will be reset, remaining only the fields that exist on the Project Beta's issue type screen.

      Workaround

      The only workaround is to make sure that the fields exist on the Issue Type screen on both projects. However, this doesn't prevent #1, which is the request being created with an invalid request type.

              Assignee:
              Unassigned
              Reporter:
              Paulo Junior (Inactive)
              Votes:
              3 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated: