I have a workflow rule that changes the case status to "SHIFTED" when the case owner is changed from one user/queue to another user/queue.
The Evaluation criteria is when a record is created, and every time it's edited.
The Rule criteria:
AND(
ISCHANGED(OwnerId),
OR(LEFT(PRIORVALUE(OwnerId),3)="005", LEFT(PRIORVALUE(OwnerId), 3)="00G"))
Workflow Action is the Field Update to New Field Value: SHIFTED.
It is working fine. But now the new criteria is, if the Case Status is "PROGRESS" then the workflow should not be fired. As the ISCHANGED function has been used, the "created, and any time it’s edited to subsequently meet criteria" cannot be chosen. I'm trying to achieve this task using Trigger. I've started(given below) but not sure how to proceed as I'm not good in triggers. If you could help me in this trigger or any other suggestions would be great.
trigger ChangeOwnerStatusIsShifted on Case (before update) {
List<Case> cases = new List<Case>();
for(Case c: Trigger.new){
if(c.Status == 'Submitted'){
cases.add(c);
}
//Code to allow changing the case owners for the cases with other Status
}
}