LiquidPlanner Classic Forum

Ask a Question
Back to All

RFE: simple "commit work on timer" endpoint

Posted on behalf of Ricardo Signes. Original posting date 2014-01-17

Imagine that I have an active timer. It has two hours elapsed. I would like to commit that time to its task, clear the timer, and add a comment to the task. Right now, this would take four API calls:

  • get timers
  • clear timer
  • add comment
  • track time

If any one of these fails, I'm left in a half-committed state, because there is (of course) no way to make an atomic set of transactions across multiple API calls.

It would be excellent if this API endpoint could also optionally stop the timer and mark the task done. Here is what I propose:

POST /api/workspace/:workspace_id/tasks/:task_id/timer/commit

Payload is a JSON Object with the following properties:

  • comment: optional string; a comment to add to the task
  • stop: optional boolean; whether to also stop the timer
  • is_done: optional boolean; whether to mark the task done

Please note that "comment" should be a comment on the task. The UI provides a way to comment while logging time, but it becomes a "task note," not an item comment, which is almost never useful. On the other hand, I believe the "comment" property on a "track_time" POST makes an item comment, as one would expect.

I would find this enhancement to be extremely useful