I got a project which needed to setup an public community as an endpoint to receive JSON messages (URL post method). My community home page got a restful apex class to receive message and process it like create or update a Case based on this message.
In my salesforce environment, I already setup an assignment rule to put new or updated Case above to a queue, this queue will assign Case to omni-channel or Live agents.
in my case, assignment rule alway automatically trigger when I update a Case even I haven't put any related code into my apex class. I know if I want to adopt any assignment rule, I need to put some code in my apex class such as following:
Database.DMLOptions dmlOpts = new Database.DMLOptions();
AssignmentRule AR = new AssignmentRule();
AR = [select id from AssignmentRule where SobjectType = 'Case' and Active = true limit 1];
dmlOpts.assignmentRuleHeader.assignmentRuleId = AR.Id;
Case cs = new Case();
cs.setOptions(dmlOpts);
based on my testing, every time I update a Case, community Site Guest User (Customer) always change updated Case ownership from me to Case queue.
based on my observation, any Case created or updated based on the parameter get from outside and pass through public site will automatically assign to site user first before trigger assignment rule. Exception only happen when I use Salesforce debug mode, In debug mode I can locally direct call related fuction and pass parameter do it. then Case update successful and assignment rule not trigger. this is because this Case owner remain the same user and no need go to ->site user->Case queue->user again.
Can someone cofirm my observation, and someone also can tell me how to stop assigment rule auto fire even got no code to trigger it.