debian-mirror-gitlab/doc/user/project/time_tracking.md

137 lines
5.2 KiB
Markdown
Raw Normal View History

2019-12-26 22:10:19 +05:30
---
type: reference
disqus_identifier: 'https://docs.gitlab.com/ee/workflow/time_tracking.html'
2020-06-23 00:09:42 +05:30
stage: Plan
group: Project Management
2021-02-22 17:27:13 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
2019-12-26 22:10:19 +05:30
---
2021-09-30 23:02:18 +05:30
# Time tracking **(FREE)**
2019-12-26 22:10:19 +05:30
2021-09-30 23:02:18 +05:30
With time tracking you can track estimates and time spent on issues and merge
requests in GitLab.
2019-12-26 22:10:19 +05:30
2021-09-30 23:02:18 +05:30
Use time tracking for these tasks:
2019-12-26 22:10:19 +05:30
- Record the time spent working on an issue or a merge request.
2021-10-27 15:23:28 +05:30
- Add or update an estimate of the total time to complete an issue or a merge
request.
2021-09-04 01:27:46 +05:30
- View a breakdown of time spent working on an issue or a merge request.
2019-12-26 22:10:19 +05:30
You don't have to indicate an estimate to enter the time spent, and vice versa.
2021-09-30 23:02:18 +05:30
Data about time tracking shows up on the issue and merge request sidebar:
2019-12-26 22:10:19 +05:30
2021-06-08 01:23:25 +05:30
![Time tracking in the sidebar](img/time_tracking_sidebar_v13_12.png)
2019-12-26 22:10:19 +05:30
## How to enter data
2021-09-30 23:02:18 +05:30
Time tracking uses two [quick actions](quick_actions.md): `/spend` and `/estimate`.
2019-12-26 22:10:19 +05:30
2021-04-29 21:17:54 +05:30
If you use either quick action more than once in a single comment, only the last occurrence is applied.
2019-12-26 22:10:19 +05:30
Below is an example of how you can use those new quick actions inside a comment.
![Time tracking example in a comment](img/time_tracking_example_v12_2.png)
2021-04-17 20:07:23 +05:30
Adding time entries (time spent or estimates) is limited to project members
with [Reporter and higher permission levels](../permissions.md).
2019-12-26 22:10:19 +05:30
### Estimates
2021-09-30 23:02:18 +05:30
To enter an estimate, type `/estimate`, 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`.
2021-04-29 21:17:54 +05:30
Check the [time units you can use](#configuration).
2019-12-26 22:10:19 +05:30
2021-10-27 15:23:28 +05:30
The estimate is designed to show the total estimated time. The estimated
time remaining is automatically calculated and displayed when hovering over
the time tracking information in the right sidebar.
![Estimated time remaining](img/remaining_time_v14_2.png)
An issue or a merge request can have only one estimate. Every time you enter a
new time estimate, it overwrites the previous value.
2019-12-26 22:10:19 +05:30
To remove an estimation entirely, use `/remove_estimate`.
### Time spent
2021-09-30 23:02:18 +05:30
To enter time spent, type `/spend`, 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](#configuration).
2019-12-26 22:10:19 +05:30
2021-02-22 17:27:13 +05:30
Every new time spent entry is added to the current total time spent for the
2019-12-26 22:10:19 +05:30
issue or the merge request.
2021-09-30 23:02:18 +05:30
To subtract time, enter a negative value. For example, `/spend -3d` removes three
2019-12-26 22:10:19 +05:30
days from the total time spent. You can't go below 0 minutes of time spent,
2021-09-30 23:02:18 +05:30
so if you remove more time than already entered, GitLab ignores the subtraction.
2019-12-26 22:10:19 +05:30
2021-06-08 01:23:25 +05:30
You can log time in the past by providing a date after the time.
2021-04-29 21:17:54 +05:30
For example, if you want to log 1 hour of time spent on the 31 January 2021,
2021-09-30 23:02:18 +05:30
you would type `/spend 1h 2021-01-31`. If you supply a date in the future, the
2021-04-29 21:17:54 +05:30
command fails and no time is logged.
2019-12-26 22:10:19 +05:30
To remove all the time spent at once, use `/remove_time_spent`.
2021-06-08 01:23:25 +05:30
## View a time tracking report
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/271409) in GitLab 13.12.
You can view a breakdown of time spent on an issue or merge request.
2021-09-04 01:27:46 +05:30
Prerequisites:
- You must have at least the [Reporter role](../permissions.md#project-members-permissions) for a project.
2021-06-08 01:23:25 +05:30
To view a time tracking report, go to an issue or a merge request and select **Time tracking report**
in the right sidebar.
![Time tracking report](img/time_tracking_report_v13_12.png)
The breakdown of spent time is limited to a maximum of 100 entries.
2019-12-26 22:10:19 +05:30
## Configuration
The following time units are available:
2021-09-30 23:02:18 +05:30
| Time unit | What to type | Default conversion rate |
| --------- | ------------ | ----------------------- |
| Month | `mo` | 4w |
| Week | `w` | 5d |
| Day | `d` | 8h |
| Hour | `h` | 60m |
| Minute | `m` | |
2019-12-26 22:10:19 +05:30
2021-03-11 19:13:27 +05:30
### Limit displayed units to hours **(FREE SELF)**
2019-12-26 22:10:19 +05:30
2020-03-13 15:44:24 +05:30
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/29469/) in GitLab 12.1.
2019-12-26 22:10:19 +05:30
2021-09-04 01:27:46 +05:30
In GitLab self-managed instances, you can limit the display of time units to
hours.
To do so:
1. On the top bar, select **Menu >** **{admin}** **Admin**.
1. On the left sidebar, select **Settings > Preferences**.
1. Expand **Localization**.
1. Under **Time tracking**, select the **Limit display of time tracking units to hours** checkbox.
1. Select **Save changes**.
2019-12-26 22:10:19 +05:30
With this option enabled, `75h` is displayed instead of `1w 4d 3h`.
2021-09-30 23:02:18 +05:30
## Related links
2019-12-26 22:10:19 +05:30
2021-09-30 23:02:18 +05:30
- [Time tracking solutions page](https://about.gitlab.com/solutions/time-tracking/)
- Time tracking GraphQL references:
2021-06-08 01:23:25 +05:30
- [Connection](../../api/graphql/reference/index.md#timelogconnection)
- [Edge](../../api/graphql/reference/index.md#timelogedge)
- [Fields](../../api/graphql/reference/index.md#timelog)
2021-10-27 15:23:28 +05:30
- [Timelogs](../../api/graphql/reference/index.md#querytimelogs)
2021-09-30 23:02:18 +05:30
- [Group timelogs](../../api/graphql/reference/index.md#grouptimelogs)
2021-10-27 15:23:28 +05:30
- [Project Timelogs](../../api/graphql/reference/index.md#projecttimelogs)
- [User Timelogs](../../api/graphql/reference/index.md#usertimelogs)