Loading

Understanding Why Salesforce Assignment Rule is Triggered Even When the Assignment Rule is Deactivated or Removed

Publiseringsdato: Apr 3, 2025
Beskrivelse

The case assignment rule will continue to update the Case Owner (as seen in the field history "Owner (Assignment)") even though there are no assignment rules or there is no active assignment rule in the org.  This is not an issue when we create a case through an Apex class, but when we create a case through the REST API.  The Case Owner is always updated if we did not use any specific setting in the REST headers from Workbench/third party.

The Assignment Rule header is a request header applied when creating or updating Accounts, Cases, or Leads. For more information, see the documentation on the REST API Assignment Rule Header.

NOTE: If it is part of a REST API call, and this header is not present, it will default to “true”.  This can result in assignment rules incorrectly executing when they were not intended to.

Any API request invoked where the Assignment Rule Header is set to invoke, this header/setting will be inherited by any other DML action performed in the same transaction. The context takes precedence over DMLOptions.  If the Assignment Rule Header is set via the UI, SOAP API, or REST API, it cannot be overridden by DMLOptions.


Løsning

Because there is an Assignment Rule present (although not active), this is working as designed.  It is loaded on entity insert, and should not be evaluated as it is inactive.  We perform default assignments, which are using the "Default Case Owner" as per the Support Settings

Even after deleting the Assignment Rule, why was the Assignment Rule triggered?

The exception to the above is, if the Rest API is used and the Sforce-Auto-Assign header is not set, as mentioned, this will default to True. During the transaction of the Case update, if there is no Assignment Rule, we will set the Assignment Rule Header to false.  

If there is a recursive update to the same Case record in the same transaction, the AutoAssign value will be reset to True. This will not be overridden during the recursive update and the AutoAssign will remain true. Since there are no Assignment Rules active, the Case is re-assigned to the “Default Case Owner”.  For more information on the Default Case Owner, see Customize Support Settings.

Knowledge-artikkelnummer

000395506

 
Laster
Salesforce Help | Article