report on priority use, by user

Added by Joe Cullin almost 10 years ago

One of our users mentioned that, "every issue from so-and-so is Urgent priority." I'd like to see the actual numbers before raising this for discussion. Can anyone suggest a good way to report on priority choices?

Requirements:
  • I want to report on the whole system. The Summary page on the issue list doesn't show up for cross-project issue lists, so I think that's out.
  • I don't mind SQL, scripting, or some manual processing. This will be a one-off task, not something I use frequently.

I see how to pull the priority and author from the issues table, as in the below query. However, I believe that shows the current priority. So it's not going to accurately reflect the issues where the assignee edited the priority. I see that the old values are stored in the journal_details table, but my SQL skills are not good enough to fetch that data and merge it with the issues table. I can cobble together a script to traverse that data, but I'm hoping someone can point me to a simpler solution.

    select firstname, enumerations.name as priority, count(*) as total from issues
    join users on author_id = users.id
    join enumerations on enumerations.id = priority_id
    group by priority_id, author_id order by enumerations.position desc, total desc, firstname