The time entry form, which is used to add time entries to Redmine, can be accessed from several places. For example, users can open this form by clicking on the Log time link, which can be found in the top-right contextual menu of the issue page. This page is shown in the following screenshot:
Similar Log time links can be found on the project overview page (on the sidebar) and on the time report page, which will be reviewed later in this chapter.
The time entry form can also be opened by selecting the Log time item in the drop-down menu that can be invoked by right-clicking on an issue in the issue list. Here is a screenshot of this menu:
But note that the Log time item does not appear in this menu if you selected more than one issue.
Also, this form is partially available within the issue edit form, which can be opened by clicking on the Update link on the issue page. It looks like this:
Note the Log time block, which is available only if the Time tracking module is enabled for the project.
The complete time entry form can be invoked using the Log time link on the system time report, which can be opened using the Overall spent time link on the Projects page. It looks like this:
As you can see, the Project and Issue fields are optional. That is, you can add time entries that are not associated with an issue and even a project. This can be useful if, for example, you need to track time that was spent on company meetings.
The Date field of this form should be set to the date when you spent the time. By default, this field is set to today's date.
The Hours field should contain the number of hours that you spent. The value of this field can be a decimal or a time in a human-readable format, for example, 30m, 30min, 1h30, 1h30m or 1:30.
While the Comment field is optional, it's recommended you use this field to briefly describe what exactly you have been doing. Generally, this comment is for your managers, so if they do not need such details, you can leave it empty.
The Activity field of this form should be set to the type of work that you were doing. If you were doing various jobs, you should create separate time entries for each type.
The Time Tracker plugin
The Time Tracker plugin, which was originally authored by Jérémie Delaitre, can simplify the process of logging time by adding Start and Stop links to the account menu (which is located in the top-right corner). Check it out at https://github.com/hicknhack-software/redmine_time_tracker.
Once you have filled in the form, you can click on either the Create button to be redirected to the page from which you came to this form, or the Create and continue button to get this form again and add another time entry.
Tracking time from a mobile device
To track time from an iPhone or Android device, you can use RedminePM, which can be found at http://redminepm.com. This is a full-featured Redmine client that supports time logging in addition to many other functions.
When we were reviewing the Repositories tab of the Settings page, which can be found in the Administration menu (we did it twice, in Chapter 3, Configuring Redmine, and Chapter 4, Issue Tracking), we skipped the part of the form that is shown in the following screenshot:
In this form, we skipped the Enable time logging and Activity for logged time settings as you knew nothing about time logging at that time. So let's now see what we can do with these settings.
If the Enable time logging setting is enabled, users will be able to add time entries through SCM commit messages. Thus, suppose a user commits changes to a repository using this command:
$ svn commit -m 'Finished controller, refs #1554 @4:30'
This will tell Redmine to add a time entry for issue #1554
with the Hours attribute set to 4 hours and 30 minutes. This time entry will use the activity that has been selected in the Activity for logged time setting. Its comment will be Applied in changeset R, where R is the revision ID. The date on which the commit has been made will be used for the Date attribute of the added time entry.
So, to add a time entry through an SCM, a user should make sure that the commit message contains a string that follows this format:
refs #N @HM
Let's discuss what it means:
*
).#N
: This is an issue number, for example, #1554
.@HM
: This specifies the time that was spent. HM
can be in a variety of formats, for example, 1h30m, 5hours, 1hour5min, 20min, 1:30, 1.5h, 2, or 8h (all without spaces).