gitlab-time-tracker icon indicating copy to clipboard operation
gitlab-time-tracker copied to clipboard

gtt report: time records have the wrong date

Open Fattouh92 opened this issue 7 years ago • 4 comments

Hi,

I start a time entry for an issue with gtt start xx and then gtt stop. I expect after gtt sync to have that entry in my report for the day I have actually done it. But doing gtt sync on a different day shows that entry for the day I have run the sync not the actual time tracking so I end up having different results with gtt log and gtt report -f xx-t xx

Fattouh92 avatar May 22 '18 14:05 Fattouh92

GitLab doesn't offer an API to submit the date when your time was actually spent (yet). I'm sorry, there's nothing I can do right here. Also see #39

kriskbx avatar May 22 '18 20:05 kriskbx

Is there an issue for the GitLab API yet? They aim to allow you to do all operatons you can do in the UI via the API as well, one just needs to poke a bit usually.

EDIT: Apparently not, https://gitlab.com/gitlab-org/gitlab-ce/issues?scope=all&utf8=%E2%9C%93&state=opened&label_name[]=time%20tracking&search=api

sils avatar Jul 04 '18 07:07 sils

I have opened an issue https://gitlab.com/gitlab-org/gitlab-ce/issues/47324 but didn't receive any reply from the team for more than a month

Fattouh92 avatar Jul 04 '18 10:07 Fattouh92

Hi all First thanks for this useful tool.

To record the spend date, the method discussed in #39 works at least for my gitlab installation (13.8.0-ee). This is by using the notes API as follows:

curl --request POST --header "PRIVATE-TOKEN: xxxxxxxxxxxx" "https://yyyyyyyy:8080/api/v4/projects/A/issues/B/notes?body=%2Fspend%2015min%202021-02-18"

see my commit here: https://github.com/ndu2/gitlab-time-tracker

I could not find any documentation on this feature, so see it as a workaround until gitlab enhances the add_spent_time API

ndu2 avatar Feb 19 '21 20:02 ndu2