@@ -712,6 +712,146 @@ Example response:
712
712
}
713
713
```
714
714
715
+ ## Set a time estimate for an issue
716
+
717
+ Sets an estimated time of work for this issue.
718
+
719
+ ```
720
+ POST /projects/:id/issues/:issue_id/time_estimate
721
+ ```
722
+
723
+ | Attribute | Type | Required | Description |
724
+ | --------- | ---- | -------- | ----------- |
725
+ | ` id ` | integer | yes | The ID of a project |
726
+ | ` issue_id ` | integer | yes | The ID of a project's issue |
727
+ | ` duration ` | string | yes | The duration in human format. e.g: 3h30m |
728
+
729
+ ``` bash
730
+ curl --request POST --header " PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/5/issues/93/time_estimate? duration=3h30m
731
+ ```
732
+
733
+ Example response:
734
+
735
+ ``` json
736
+ {
737
+ "human_time_estimate" : " 3h 30m" ,
738
+ "human_total_time_spent" : null ,
739
+ "time_estimate" : 12600 ,
740
+ "total_time_spent" : 0
741
+ }
742
+ ```
743
+
744
+ ## Reset the time estimate for an issue
745
+
746
+ Resets the estimated time for this issue to 0 seconds.
747
+
748
+ ```
749
+ POST /projects/:id/issues/:issue_id/reset_time_estimate
750
+ ```
751
+
752
+ | Attribute | Type | Required | Description |
753
+ | --------- | ---- | -------- | ----------- |
754
+ | ` id ` | integer | yes | The ID of a project |
755
+ | ` issue_id ` | integer | yes | The ID of a project's issue |
756
+
757
+ ``` bash
758
+ curl --request POST --header " PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/5/issues/93/reset_time_estimate
759
+ ```
760
+
761
+ Example response:
762
+
763
+ ``` json
764
+ {
765
+ "human_time_estimate" : null ,
766
+ "human_total_time_spent" : null ,
767
+ "time_estimate" : 0 ,
768
+ "total_time_spent" : 0
769
+ }
770
+ ```
771
+
772
+ ## Add spent time for an issue
773
+
774
+ Adds spent time for this issue
775
+
776
+ ```
777
+ POST /projects/:id/issues/:issue_id/add_spent_time
778
+ ```
779
+
780
+ | Attribute | Type | Required | Description |
781
+ | --------- | ---- | -------- | ----------- |
782
+ | ` id ` | integer | yes | The ID of a project |
783
+ | ` issue_id ` | integer | yes | The ID of a project's issue |
784
+ | ` duration ` | string | yes | The duration in human format. e.g: 3h30m |
785
+
786
+ ``` bash
787
+ curl --request POST --header " PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/5/issues/93/add_spent_time? duration=1h
788
+ ```
789
+
790
+ Example response:
791
+
792
+ ``` json
793
+ {
794
+ "human_time_estimate" : null ,
795
+ "human_total_time_spent" : " 1h" ,
796
+ "time_estimate" : 0 ,
797
+ "total_time_spent" : 3600
798
+ }
799
+ ```
800
+
801
+ ## Reset spent time for an issue
802
+
803
+ Resets the total spent time for this issue to 0 seconds.
804
+
805
+ ```
806
+ POST /projects/:id/issues/:issue_id/reset_spent_time
807
+ ```
808
+
809
+ | Attribute | Type | Required | Description |
810
+ | --------- | ---- | -------- | ----------- |
811
+ | ` id ` | integer | yes | The ID of a project |
812
+ | ` issue_id ` | integer | yes | The ID of a project's issue |
813
+
814
+ ``` bash
815
+ curl --request POST --header " PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/5/issues/93/reset_spent_time
816
+ ```
817
+
818
+ Example response:
819
+
820
+ ``` json
821
+ {
822
+ "human_time_estimate" : null ,
823
+ "human_total_time_spent" : null ,
824
+ "time_estimate" : 0 ,
825
+ "total_time_spent" : 0
826
+ }
827
+ ```
828
+
829
+ ## Get time tracking stats
830
+
831
+ ```
832
+ GET /projects/:id/issues/:issue_id/time_stats
833
+ ```
834
+
835
+ | Attribute | Type | Required | Description |
836
+ | --------- | ---- | -------- | ----------- |
837
+ | ` id ` | integer | yes | The ID of a project |
838
+ | ` issue_id ` | integer | yes | The ID of a project's issue |
839
+
840
+ ``` bash
841
+ curl --request GET --header " PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/5/issues/93/time_stats
842
+ ```
843
+
844
+ Example response:
845
+
846
+ ``` json
847
+ {
848
+ "human_time_estimate" : " 2h" ,
849
+ "human_total_time_spent" : " 1h" ,
850
+ "time_estimate" : 7200 ,
851
+ "total_time_spent" : 3600
852
+ }
853
+ ```
854
+
715
855
## Comments on issues
716
856
717
857
Comments are done via the [ notes] ( notes.md ) resource.
0 commit comments