summaryrefslogtreecommitdiff
path: root/doc/en_US/api-subtask-time-tracking-procedures.markdown
diff options
context:
space:
mode:
Diffstat (limited to 'doc/en_US/api-subtask-time-tracking-procedures.markdown')
-rw-r--r--doc/en_US/api-subtask-time-tracking-procedures.markdown102
1 files changed, 102 insertions, 0 deletions
diff --git a/doc/en_US/api-subtask-time-tracking-procedures.markdown b/doc/en_US/api-subtask-time-tracking-procedures.markdown
new file mode 100644
index 00000000..67447623
--- /dev/null
+++ b/doc/en_US/api-subtask-time-tracking-procedures.markdown
@@ -0,0 +1,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
+}
+```