I'm adding a Case via the REST API, but the OwnerId
field isn't being set.
I've also tried updating the Case record afterwards, and still the OwnerId
isn't updated.
I am able to set/update the Case OwnerId
via Apex and the Salesforce UI, with the same user.
RESP API request body (where OwnerId
is the ID of the Queue to assign the Case to):
{
"OwnerId": "XXXXXXXXXXXXXXXXXX",
"Subject": "Test Case",
"Comments": "This is a test. Please ignore.",
"Origin": "Web",
"SuppliedEmail": "[email protected]"
}
Response:
{
"id": "XXXXXXXXXXXXXXXXXX",
"success": true,
"errors": []
}
The following Apex, ran with the same user, works as expected:
Case c = new Case();
c.OwnerId = 'XXXXXXXXXXXXXXXXXX';
c.Subject = 'Test Case';
c.Comments = 'This is a test. Please ignore.';
c.Origin = 'Web';
c.SuppliedEmail = '[email protected]';
insert c;