Gemini Community Support Site

This Gemini community support site can be used to find solutions to product issues. You can log in using Open Id, Google Profile and even Facebook. Feel free to ask a question or browse FAQs and documentation. Product tour videos are also available along with how-to videos demonstrating key Gemini capabilities.




Time Report grouped by user

web-app

I recently implemented the Time Tracking in my organization.
Each developer needs to log their time spent working on the various issues.
I need to create a weekly report which will display how long each Developer spent that week, broken out by Time Type.
The default report in the Time tab under AllProjects, reports on exactly what I am looking for.  However I need to be able to group this data by user.  So instead of clicking on each user 1 at a time, I want to know if there is a report somewhere which already has this information?

rlevine
· 1
rlevine
Replies (8)
helpful
0
not helpful

You should be able to Control-Click to select multiple Resources.


Harvey Kandola
· 212
Harvey Kandola
helpful
0
not helpful

Yes I can, which can be cumbersome when there are a lot of users.  It would be nice if we can save it similar to saved filters.
However, more importantly, it is still grouping the report by Project and then user.  I would like to see it the other way, by user and then by project.


rlevine
· 1
rlevine
helpful
0
not helpful

Understood.

We will implement for 4.5 release (end of year).


Harvey Kandola
· 212
Harvey Kandola
helpful
0
not helpful

Ok, thanks Harvey.  Looking forward to this, as it will make my life a lot easier.
In the meantime, what query can I create which will ultimately give me the same result?

May I also request at the same time to include in the next release, creating the ability so that certain users or groups of user, can be notified when issue status's change to specific status types?  Specifically, after a developer implements their change, they mark the issue status to Ready For Testing, I would like the QA Team Lead to be notified when an issue status changes to Ready For Testing, so that it can be assigned to a member of his team.  I think it would be great if you can make this setting either global to all projects with the ability to possibly set it differently (different member alerts) for different projects.


rlevine
· 1
rlevine
helpful
0
not helpful

I would be extremely grateful if you could formally log your requests @ http://gemini.countersoft.com !


Harvey Kandola
· 212
Harvey Kandola
helpful
0
not helpful

Created GEM-4085 .
Do you have a sql script which I can execute to get the time report requested above?


rlevine
· 1
rlevine
helpful
0
not helpful

I am posting this in case anybody else wants to make use of it.  I created these 2 TSql queries/scripts.

The first is a query which only returns on each user row, the sum total of hours and minutes that user logged in the past week.  The second is a script which returns the sum total (hours + minutes) for both the project and Time Type logged for each user in the past week.

SELECT timereport.*, SUM(timereportb.hourslogged) sumhours, SUM(timereportb.minuteslogged) summinutes
FROM (
    SELECT usr.firstname + ' ' + usr.surname as [UserName],
           proj.projectcode as project
code,
           proj.projectname as projectname,
           issue.issueid as issue
id,
           issue.summary as issuesummary,
           time.hours as hours
logged,
           time.minutes as minuteslogged,
           time.comment as time
comment,
           timetype.timetypename as timetype,
           time.timeentrydate as time
for,
           time.created    as timeentereddate
    FROM geminitimetracking time
         join gemini
users usr on time.userid = usr.userid
         join geminiissues issue on time.issueid = issue.issueid
         join gemini
projects proj on time.projectid = proj.projectid
         left join geminiissuetimetype timetype on time.timetypeid = timetype.timetypeID
    ) time
report
cross join (
    SELECT usr.firstname + ' ' + usr.surname as [UserName],
           proj.projectcode as projectcode,
           proj.projectname as project
name,
           issue.issueid as issueid,
           issue.summary as issue
summary,
           time.hours as hourslogged,
           time.minutes as minutes
logged,
           time.comment as timecomment,
           timetype.timetypename as time
type,
           time.timeentrydate as timefor,
           time.created    as time
entereddate
    FROM gemini
timetracking time
         join geminiusers usr on time.userid = usr.userid
         join gemini
issues issue on time.issueid = issue.issueid
         join geminiprojects proj on time.projectid = proj.projectid
         left join gemini
issuetimetype timetype on time.timetypeid = timetype.timetypeID
    ) timereportb
where time
report.UserName = timereportb.UserName
  and time
report.timefor between DATEADD(wk, DATEDIFF(wk, 6, DATEADD(wk,-1, getdate())), 6) and DATEADD(wk, DATEDIFF(wk, 5, DATEADD(wk,-1, getdate())), 5)
group by time
report.UserName,timereport.projectcode,timereport.projectname,timereport.issueid,timereport.issuesummary,timereport.hourslogged,timereport.minuteslogged,timereport.timecomment,timereport.timetype,timereport.timefor,timereport.timeentereddate
order by time
report.UserName, timereport.timetype, timereport.timefor, timereport.projectcode, timereport.issueid






IF OBJECTID('tempdb..#temp') IS NOT NULL
  drop table #temp

select *
  into #temp
  from (
        SELECT time.entryid as id,
               usr.firstname + ' ' + usr.surname as [UserName],
               proj.projectcode as project
code,
               proj.projectname as projectname,
               issue.issueid as issue
id,
               issue.summary as issuesummary,
               time.hours as hours
logged,
               time.minutes as minuteslogged,
               time.comment as time
comment,
               timetype.timetypename as timetype,
               time.timeentrydate as time
for,
               time.created    as timeentereddate,
               CONVERT(numeric(6,2),0) as timetyperunningtotal,
               CONVERT(numeric(6,2),0) as user
runningtotal
            FROM gemini
timetracking time
                 join geminiusers usr on time.userid = usr.userid
                 join gemini
issues issue on time.issueid = issue.issueid
                 join geminiprojects proj on time.projectid = proj.projectid
                 left join gemini
issuetimetype timetype on time.timetypeid = timetype.timetypeID
         ) timereport
where time
for between DATEADD(wk, DATEDIFF(wk, 6, DATEADD(wk,-1, getdate())), 6) and DATEADD(wk, DATEDIFF(wk, 5, DATEADD(wk,-1, getdate())), 5)
order by UserName, timetype, timefor, projectcode, issueid

declare @Id int
declare @UserName varchar(150)
declare @ProjectCode varchar(20)
declare @ProjectName varchar(50)
declare @IssueId int
declare @IssueSummary varchar(2000)
declare @HoursLogged smallint
declare @MinutesLogged smallint
declare @TimeComment varchar(2000)
declare @TimeType varchar(50)
declare @TimeFor as Date
declare @TimeEntered DateTime
declare @RunningTotal float
declare @RunningHours int
declare @RunningMinutes int
declare @LastUser varchar(150) = ''
declare @LastTT varchar(50) = ''
declare @TTRunningTotal float
declare @TTRunningHours int
declare @TTRunningMinutes int

DECLARE @cur CURSOR
SET @cur = CURSOR STATIC FOR
            select
              from #temp
            order by UserName, time_type, time_for, project_code, issue_id
           
OPEN @cur
FETCH @cur INTO @Id,@UserName,@ProjectCode,@ProjectName,@IssueId,@IssueSummary,@HoursLogged,@MinutesLogged,@TimeComment,@TimeType,@TimeFor,@TimeEntered,@TTRunningTotal,@RunningTotal
           
WHILE (@@FETCH_STATUS <> -1)
BEGIN
  if (@UserName <> @LastUser)
  begin
    set @RunningTotal = 0
    set @RunningHours = 0
    set @RunningMinutes = 0
   
    set @TTRunningTotal = 0
    set @TTRunningHours = 0
    set @TTRunningMinutes = 0
  end
  else if (@TimeType <> @LastTT)
  begin
    set @TTRunningTotal = 0
    set @TTRunningHours = 0
    set @TTRunningMinutes = 0
  end
 
  set @RunningHours = @RunningHours + @HoursLogged   
  set @RunningMinutes = @RunningMinutes + @MinutesLogged
  set @RunningTotal = (@RunningHours + (@RunningMinutes/60)) + ((@RunningMinutes%60)
.01)
 
  set @TTRunningHours = @TTRunningHours + @HoursLogged   
  set @TTRunningMinutes = @TTRunningMinutes + @MinutesLogged
  set @TTRunningTotal = (@TTRunningHours + (@RunningMinutes/60)) + ((@RunningMinutes%60)*.01)
       
  update #temp
    set timetyperunningtotal = @TTRunningTotal,
        user
running_total = @RunningTotal
  where id = @Id
 
 
  set @LastUser = @UserName
  set @LastTT = @TimeType
  FETCH @cur INTO @Id,@UserName,@ProjectCode,@ProjectName,@IssueId,@IssueSummary,@HoursLogged,@MinutesLogged,@TimeComment,@TimeType,@TimeFor,@TimeEntered,@TTRunningTotal,@RunningTotal
END   
CLOSE @cur
DEALLOCATE @cur
select * from #temp
delete from #temp


rlevine
· 1
rlevine
helpful
0
not helpful

Thanks for sharing.


Harvey Kandola
· 212
Harvey Kandola