Opened 7 years ago

Closed 7 years ago

# Log hours on different date

Reported by: Owned by: Jochus Russ Tyndall normal TimingAndEstimationPlugin normal patch useful-sql 0.12

### Description

Hi,

Is it possible to log hours on a date in the past? I'm willing to do this, to make sure my burndown chart looks ok :-) !

Jochen

### comment:1 Changed 7 years ago by Russ Tyndall

Keywords: patch useful-sql added → wontfix new → closed

You can certainly manually insert hours/totalhours changes into the ticket_change table in trac. It will be a little ugly to update the total hours on every ticket change after that time, but doable.

! THIS IS TOTALLY UNDEBUGGED, USE WITH CARE: Obviously, use python or your database's parameter syntax, but something like:

  $total_hours = (SELECT SUM(newvalue) FROM ticket_change WHERE ticket=$ticket_id and time < $change_timestamp and field='hours') INSERT INTO ticket_change (ticket, time, author, field, oldvalue, newvalue) VALUES($ticket_id, $change_timestamp,$change_author, 'hours', 0 , $hours_to_add ) INSERT INTO ticket_change (ticket, time, author, field, oldvalue, newvalue) VALUES($ticket_id, $change_timestamp,$change_author, 'total_hours',
$total_hours ,$total_hours + $hours_to_add ); UPDATE ticket_change SET old_value = old_value +$hours_to_add,
new_value = new_value + $hours_to_add WHERE ticket=$ticket_id and time > $change_timestamp and field='totalhours'; UPDATE ticket_custom SET value = value +$hours_to_add
WHERE ticket=\$ticket_id and name='totalhours';



However, this falls outside of my usage case for this plugin. My company acceleration.net is happy to write you a plugin that can supply this additional functionality, but I am unable to donate time towards this.

Russ Tyndall

### comment:2 Changed 7 years ago by Russ Tyndall

As an aside this could probably be done as an admin page or something. I was initially very concerned about adding more fields to the layout, as that is already a bit of box soup.

Also patches welcome, if you take the above code and turn it into a patch that adds an admin page, I will happily include it in the plugin

### comment:3 Changed 7 years ago by Jochus

Russ,

Thanks! :-) ! I'm willing to patch this, but I also need to find time to do this :-)

Jochen

### Modify Ticket

Change Properties