function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RevJoelRevJoel 

Who is taking ownership of Queue Cases?

I am trying to create a report showing who is taking ownership of queue owned cases (Accepting Queue cases). Case history reports don't work for us as I am trying to determine who the first person is to grab a case from the queue.

 

Once that is done, I need to group them by rep so we can analyze who is taking the most cases (to ensure an even distribution of cases amongst our Tier 1 reps). 

 

Thanks for any help anyone can provide. Salesforce Support wasn't able to come up with anything.

sfdcfoxsfdcfox

Your only OOTB solution is the case history report. Just use a filter of "action equals accepted." If this won't work, then you'll have to build something custom. Here's my thought:

 

First, create a user lookup field called "First_Accept__c" (or whatever you prefer, I'm not feeling original tonight).

 

Next, add this trigger (again, xxx is just a placeholder, feel free to change it):

 

trigger xxx on case (before update) {
  set<id> owners = new set<id>();
  for(case c:trigger.old) {
    owners.add(c.ownerid);
  }
  owners.removeAll(new map<id,user>([select id from user where id in :owners]).keyset());
  for(case c:trigger.new) {
     if(c.ownerid==userinfo.getuserid() && owners.contains(trigger.oldmap.get(c.id).ownerid) && c.first_accept__c==null) {
      c.first_accept__c = userinfo.getuserid();
    }
  }
}

Third, write some test code to make this deploy.

 

Fourth, build your reports!

 

This only works going forward, so you'll still need a way to data load prior activity into the old cases, but this trigger will correctly log all new cases that change ownership from any queue to the current user (which implies that they accepted the record).

 

Make the field read-only for normal users.

RevJoelRevJoel

Thanks for the reply, sfdcfox. Unfortunately, I am limited to Professional Edition so I do not have Triggers available to me. One would think that this would be standard functionality or even a standard report in the application. I would think that many other companies out there would like to track this information as well. Are we truly that unique? Hmm....

 

Back to the drawing board. Thanks again.

RevJoelRevJoel

In running my Case History Report, I am able to see the results I need in my list.

 

What I really need is the ability to filter on 'Old Value' of the Case Owner field. If Old Value = Tier 1, I want those results by case owner. Seems simple.

RevJoelRevJoel

OK. I got as close as I think I am ever going to get. Here is what I did:

 

1. For Tier 1 queue cases, since they are created by a user named Helpdesk, and we have a separate field called Opened by that the users enter their name into when they accept a case, I ran a filter on Opened by contains (first names of all tier 1 associates) and Created by equals 'Helpdesk'. That works good.

 

2. For Tier 2, it was trick, but here is what I figured out:  I ran a case history report with the following filters:

Field/Event equals Case owner

Edited by contains "(first names of Tier 2 reps)"

 

I then grouped by 'Edited by' and also by 'Old Value' (which is the old case owner.

 

When I ran the report, I created a graph of Edited By on the X-axis and Record Count on the Y-axis. Since it was grouped by 'Old Value', on the stacked bar chart, you can discern the color of those cases that were owned by the Tier 2 queue and can compare the Tier 2 reps one to another. Not ideal, but it works.

RevJoelRevJoel

I have an idea and that is to set a flag when a case is assigned to a specific queue. Once that is set (and sticks), if a user takes ownership of a case out of the queue, I can run a history report sorted by case owner when this flag is 'true'. Does anyone have an idea how I would code this? Any help would be greatly appreciated.

 

Thanks,

 

Joel

RevJoelRevJoel

Bump.

 

Does anyone know how I would create a formula field that would set the value to Yes if the case owner has ever been changed to Tier 2 queue or Tier 3 queue? Surely this can be done. Similar to the Escalated flag. The issue is once the case gets escalated to Tier 2 queue or Tier 3 queue then someone takes ownership out of the queue, the flag cannot be reset. It must stay checked.

 

Ideas??

 

Thanks,

Joel