doc/user/project/time_tracking.md
{{< details >}}
{{< /details >}}
{{< history >}}
{{< /history >}}
Time tracking helps record and manage time invested in GitLab work items. Time tracking:
You can see time tracking information in the right sidebar of your work items:
Enter and remove time tracking data using quick actions or the user interface. Type quick actions on their own lines. If you use any quick action more than once in a single comment, only its last occurrence is applied.
Different time tracking features are available based on your role:
The estimate is designed to show the total time needed to complete an item.
You can see the estimated time remaining when you hover over the time tracking information in the right sidebar.
Prerequisites:
To enter an estimate, use the /estimate quick action, followed by the time.
For example, if you need to enter an estimate of 1 month, 2 weeks, 3 days, 4 hours, and 5 minutes,
type /estimate 1mo 2w 3d 4h 5m.
Check the time units you can use.
An item can have only one estimate. Every time you enter a new time estimate, it overwrites the previous value.
Prerequisites:
To remove an estimate entirely, use the /remove_estimate quick action.
As you work, you can log the time you've spent.
Every new time spent entry is added to the current total time spent for the issue, task, or the merge request.
The total amount of time spent on an issue, task, or merge request cannot exceed 4 years.
Prerequisites:
{{< history >}}
{{< /history >}}
To add a time entry using the user interface:
In the Time tracking section of the sidebar, select Add time entry ({{< icon name="plus" >}}). A dialog opens.
Enter:
Select Save.
The Spent total in the sidebar is updated and you can view all entries in a time tracking report.
To enter time spent, use the /spend quick action, followed by the time.
For example, if you need
to log 1 month, 2 weeks, 3 days, 4 hours, and 5 minutes, type /spend 1mo 2w 3d 4h 5m.
Check the time units you can use.
To add a time tracking report entry with a note, create a comment with a description and the quick action. It then shows in the time tracking report Summary/Notes column. For example:
Draft MR and respond to initial comments
/spend 30m
To log when time was spent, enter a date after the time, using the YYYY-MM-DD format.
For example, to log 1 hour of time spent on 31 January 2021,
enter /spend 1h 2021-01-31.
If you type a future date, no time is logged.
{{< history >}}
commit_time_tracking. Disabled by default.commit_time_tracking removed.{{< /history >}}
You can record time spent on issues directly in commit messages. This approach is useful when you want to track time as you work, without updating the issue separately.
To add time spent in a commit message, include an issue reference and a time tracking marker in the format @<time> with no spaces between time units.
For example:
Fix a bug in the login form #123 @1mo2d3h15m
This commit message adds 1 month, 2 days, 3 hours, and 15 minutes of time spent to issue #123.
The time tracking marker must:
@ symbol.mo), days (d), hours (h), minutes (m), and seconds (s).When you push a commit with time tracking information:
Time is added to an issue from a commit message only if the commit author has permission to update the issue:
Multiple time amounts in one commit
When a commit message references multiple issues with different time amounts, only the first time amount is applied to all referenced issues.
For example, this commit message:
Fixes #41 @1h30m and fixes #40 @2h
Adds 1h30m to both issue #41 and issue #40. The second time amount (@2h) is ignored.
Duplicate time entries from commit SHA changes
When a commit's SHA changes (for example, after rebasing or amending), GitLab treats it as a new commit for time tracking. This can create duplicate time entries if both the original and new commits are referenced in the issue.
To avoid duplicate time entries when commit SHAs might change:
When you merge a merge request containing commits with time tracking information, GitLab prevents duplicate time tracking:
Prerequisites:
To subtract time, enter a negative value. For example, /spend -3d removes three
days from the total time spent. You can't go below 0 minutes of time spent,
so if you remove more time than already entered, GitLab ignores the subtraction.
{{< history >}}
{{< /history >}}
A timelog is a single entry of time spent, either positive or negative.
Prerequisites:
To delete a timelog, either:
Prerequisites:
To delete all the time spent at once, use the /remove_time_spent quick action.
To view a time tracking report of time spent on an item:
The breakdown of spent time displayed is limited to a maximum of 100 entries.
{{< details >}}
{{< /details >}}
{{< history >}}
global_time_tracking_report. Disabled by default.{{< /history >}}
[!flag] On GitLab Self-Managed, by default this feature is not available. To make it available, an administrator can enable the feature flag named
global_time_tracking_report. On GitLab.com, this feature is available. On GitLab Dedicated, this feature is not available. This feature is not ready for production use.
View a report of time spent in issues, tasks, and merge requests across all of GitLab.
This feature is an experiment. If you find a bug, let us know in the feedback issue.
To view the global time tracking report:
/-/timelogs to your base URL. For example, https://gitlab.example.com/-/timelogs.@ symbol.The following time units are available:
| Time unit | What to type | Conversion rate |
|---|---|---|
| Month | mo, month, or months | 4 w (160 h) |
| Week | w, week, or weeks | 5 d (40 h) |
| Day | d, day, or days | 8 h |
| Hour | h, hour, or hours | 60 m |
| Minute | m, minute, or minutes |
{{< details >}}
{{< /details >}}
GitLab administrators can limit the display of time units to hours. To do so:
With this option enabled, 75h is displayed instead of 1w 4d 3h.