summaryrefslogtreecommitdiff
path: root/doc/en_US/api-subtask-time-tracking-procedures.markdown
blob: 674476239530f36758f75be1e1f816185871f4eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
Subtask Time Tracking API procedures
====================================

## hasSubtaskTimer

- Purpose: **Check if a timer is started for the given subtask and user**
- Parameters:
    - **subtask_id** (integer, required)
    - **user_id** (integer, optional)
- Result on success: **true**
- Result on failure: **false**

Request example:

```json
{"jsonrpc":"2.0","method":"hasSubtaskTimer","id":1786995697,"params":[2,4]}
```

Response example:

```json
{
    "jsonrpc": "2.0",
    "result": true,
    "id": 1786995697
}
```

## setSubtaskStartTime

- Purpose: **Start subtask timer for a user**
- Parameters:
    - **subtask_id** (integer, required)
    - **user_id** (integer, optional)
- Result on success: **true**
- Result on failure: **false**

Request example:

```json
{"jsonrpc":"2.0","method":"setSubtaskStartTime","id":1168991769,"params":[2,4]}
```

Response example:

```json
{
    "jsonrpc": "2.0",
    "result": true,
    "id": 1168991769
}
```

## setSubtaskEndTime

- Purpose: **Stop subtask timer for a user**
- Parameters:
    - **subtask_id** (integer, required)
    - **user_id** (integer, optional)
- Result on success: **true**
- Result on failure: **false**

Request example:

```json
{"jsonrpc":"2.0","method":"setSubtaskEndTime","id":1026607603,"params":[2,4]}
```

Response example:

```json
{
    "jsonrpc": "2.0",
    "result": true,
    "id": 1026607603
}
```

## getSubtaskTimeSpent

- Purpose: **Get time spent on a subtask for a user**
- Parameters:
    - **subtask_id** (integer, required)
    - **user_id** (integer, optional)
- Result on success: **number of hours**
- Result on failure: **false**

Request example:

```json
{"jsonrpc":"2.0","method":"getSubtaskTimeSpent","id":738527378,"params":[2,4]}
```

Response example:

```json
{
    "jsonrpc": "2.0",
    "result": 1.5,
    "id": 738527378
}
```