Project

General

Profile

Actions

Feature #16821

open

Time tracking : duration since last update on issue

Added by Richard Bergoin over 10 years ago. Updated over 9 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Time tracking
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

Here is a common workflow : issue is new, then assigned to someone, then resolved by the assignee.

The idea is to know how much time has passed since last issue update (only shown if duration is < 24h) to help user to track their spent time on the issue : we actually look at last issue update date to do this : a hint just next to the "Spent time" field should be welcome :

Maybe a plugin already do this, but I think it should be part of base redmine feature set.


Files

redmine-time-tracking.png (15.9 KB) redmine-time-tracking.png Richard Bergoin, 2014-05-07 09:36
Actions #1

Updated by Richard Bergoin over 9 years ago

Just done it :

Some addition to app/views/issues/_edit.html.erb (4 first lines are from the original template) :

<% if User.current.allowed_to?(:log_time, @project) %>
        <fieldset class="tabular"><legend><%= l(:button_log_time) %></legend>
        <%= labelled_fields_for :time_entry, @time_entry do |time_entry| %>
        <div class="splitcontentleft">
        <p><%= time_entry.text_field :hours, :size => 6, :label => :label_spent_time %> <%= l(:field_hours) %>
<span> - Last change : </span><span id="time_elapsed_since_last_update"><%= distance_of_time_in_words(Time.now, @issue.updated_on) %></span> <a id="time_elapsed_since_last_update_link" title="Refresh elapsed time" href="#" onclick="reloadTimeElapsedSinceLastUpdate();return false;">(reload)</a>
<script>
hookedShowAndScrollTo = showAndScrollTo;
reloadTimeElapsedSinceLastUpdate= function() { $("#time_elapsed_since_last_update").load('/issues/<%= @issue.id %>.json?key=<%= User.current.api_key %>', function(data){ var json = JSON.parse(data); $("#time_elapsed_since_last_update").text(json.issue["label_updated_time"]); } ); }
showAndScrollTo = function(toShow, toScroll) { reloadTimeElapsedSinceLastUpdate(); hookedShowAndScrollTo(toShow, toScroll); }
</script>

and one line to app/views/issues/show.api.rsb :

 api.label_updated_time distance_of_time_in_words(Time.now, @issue.updated_on)
Actions

Also available in: Atom PDF