Loading

Salesforce Case Assignment Rule Triggers Unexpectedly via REST API Even When Deactivated or Deleted

Julkaisupäivä: Jun 2, 2026
Kuvaus

The Case Assignment Rule continues to update the Case Owner (visible as "Owner (Assignment)" in field history) even when there are no active assignment rules in the org, or when all assignment rules have been deleted. This behavior occurs specifically when cases are created or updated through the REST API — not through Apex classes or the Salesforce UI.
The Assignment Rule Header (Sforce-Auto-Assign) is a REST API request header that controls whether assignment rules execute when creating or updating Accounts, Cases, or Leads. If this header is not present in a REST API request, it defaults to true, causing assignment rules to execute even when none are active.
Important: Any API request where the Assignment Rule Header is set to invoke will inherit that setting across all DML actions in the same transaction. This context takes precedence over DMLOptions. If set via UI, SOAP API, or REST API, it cannot be overridden by DMLOptions.
Real-World Example: A third-party integration creates cases via REST API without explicitly setting Sforce-Auto-Assign: false in the request headers. Even though all assignment rules are deactivated, the case is reassigned to the Default Case Owner because the header defaults to true.

Ratkaisu

This article explains why Case Assignment Rules may continue to execute even when deactivated or deleted, particularly when cases are created or updated via the REST API without explicitly setting the Sforce-Auto-Assign header.
Because there is an Assignment Rule present (even if not active), this is working as designed. It is loaded on entity insert and should not be evaluated as it is inactive. The system performs default assignments using the "Default Case Owner" as defined in Support Settings.

Why Does the Assignment Rule Trigger Even After Deleting the Rule?

If the REST API is used and the Sforce-Auto-Assign header is not set, the header defaults to true. During the transaction of a Case update, if there is no Assignment Rule, the system sets the Assignment Rule Header to false.
However, if there is a recursive update to the same Case record in the same transaction, the AutoAssign value resets to true. This reset is not overridden during the recursive update, so AutoAssign remains true. Since no assignment rules are active, the case is reassigned to the Default Case Owner.

Resolution Steps

To prevent unexpected assignment when using REST API:

  1. Explicitly include the Sforce-Auto-Assign: false header in your REST API requests that create or update Cases.
  2. Review your integration code to ensure the header is set in all relevant API calls.
  3. For more information on the Default Case Owner, see Customize Support Settings (linked in Additional Resources).
Knowledge-artikkelin numero

000395506

 
Ladataan
Salesforce Help | Article