Webhook - actions for time tracking (recognize running timer) - and reverse webhook for stopping time tracking

to improve my time tracking in awork, i need to signalize trough webhooks to an external service if my time tracking is actually running (timer) or if its stopped.

In the webhooks there are 3 time tracking options available as actions.
Time updated, added and deleted.

Time added does also fire when the timer is started and running.
Time updated does also fire when time tracking has stopped.

So it kind of works to fire the webhook for send a signal when starting and stopping the time tracking timer.
But it fires also when time entries are manually created or updated.

So it fires also with this „FALSE POSITIVES“.

How can i only fire it when time tracking has started or stopped and not when entries are created or edited manually?

Then at last I need also a reverse webhook, that my external service can stop the time tracking if its logic is telling so (i use presence detection in the office and wish to stop time tracking if i forget to stop it manually)

Hey @alan,
welcome to the community :raised_hands:t3:

We use the TimeTrackingModel for both the timer and manual timetracking, so there are unfortunately no timer specific events. I would suggest you filter the events.

  • A running timetracking always matches the following condition: has a StartDate, StartTime, no EndTime, and the Duration set to 0.
  • We always only allow one running timetracking at a time with this condition.
  • On stop, the EndTime, EndDate, and Duration properties are set, so if the update sets the EndTime from null to a value, the timer was stoppped, or if the Duration is changed from 0 to something > 0.

In awork itself, you unfortunately cannot filter for any specific conditions, so you would have to do that in your target system/some kind of middleware.

For the stop you can do a POST /users/{userId}/timetracking/stop, see awork API

Hope this helps!