Search code examples
mysqlbugzilla

Adding filter to a for a query of groups a user belongs in bugzilla


select
  profiles.realname as User_Name,
  sum(ba.added) as Hours_Worked
from
  bugs_activity ba join user_group_map u on ba.who = u.user_id
  join profiles on ba.who = profiles.userid
where
  u.group_id = '15' and
  ba.fieldid = '47' and
  YEARweek(ba.bug_when) = YEARweek(CURRENT_DATE)
group by ba.who;

This query now can find the time for users in a group.

I have learned lot on this site from other users posts, thanks everyone.


Solution

  • Updated my original question with the script, with the script I figured out.