Issue Summary
PATCH call towards /align/api/2/Users/<id> results in HTTP 400 Error: Bad Request error message when the following fields are empty instead of null:
"company": "", "companyId": "",
User system role update in UI is successfull, and both fields are set to null immediately.
Steps to Reproduce
- Find any user that has company and/or companyId values set to '' (empty) instead of null
- Make a PATCH call towards /align/api/2/Users/<id> with the following request body:
(in this example, the API is trying to change user's system role):
[ { "op": "replace", "path": "/roleId", "value": <integer> } ]
- Notice the error
Expected Results
- Given company and/or companyId fields are NOT mandatory, the PATCH call should flawlessly update user's details regardless of company and/or companyId values.
Actual Results
- Notice the following error code is returned, along with the respective response body:
HTTP 400 Error: Bad Request Cannot update user with id <id>. company must be between 1 and 100 characters. companyId must be between 1 and 50 characters.
Workaround
Reportedly working on Build 10.88.0.15267
- Make the PATCH call by using the following request body in addition to the data you want to update:
(update user's system role on this case)[ { "op": "replace", "path": "/companyId", "value": null }, { "op": "replace", "path": "/company", "value": null }, { "op": "replace", "path": "/roleId", "value": <integer> } ]
- relates to
-
JIRAALIGN-2923 Import : Users : Empty companyId does not set value to NULL
- Closed
- resolves
-
ALIGNSP-8307 Loading...