Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get total time spend in Gitlab?

Is there a way to get the total time spend on all issues that a user have spend with the time tracking /spend slash command?

Time tracking stats with the API gets just a small amount of data: https://docs.gitlab.com/ce/api/issues.html#get-time-tracking-stats

Gitlab CE 9.1.4

like image 579
Ventolinmono Avatar asked May 24 '17 18:05

Ventolinmono


People also ask

How do I remove time spent in GitLab?

You can remove time by entering a negative amount: /spend -3d will remove 3 days from the total time spent. You can't go below 0 minutes of time spent, so GitLab will automatically reset the time spent if you remove a larger amount of time compared to the time that was entered already.

What is GitLab weight?

Issue weight is an estimate of how much time is required to complete the tasks in the issue. Time. Weight. <4 hours.


1 Answers

As I see it is possible to parse comments from API v3 and calculate total.

For example,

https://gitlab.com/api/v3/projects/:id/issues/:issue_id/notes?private_token=your_token

{
  id: 73113225,
  body: "added 1h of time spent at 2018-05-15",
  attachment: null,
  author: {
    ...
    username: "mnvxxx",
  },
  ...
}

More info: https://docs.gitlab.com/ee/api/notes.html

UPDATE

Currently I has created instrument for calculating spent time by every contributor. I hope it will be helpful:

https://github.com/zubroide/gitpab

like image 129
Nick Avatar answered Sep 16 '22 15:09

Nick