Add filter for billable status, time entry tags and allow to get all time entries for all users without user fetching before (reduce required API calls a lot)
complete
Julian Pustkuchen
Context:
We needed a custom tool fetching time entries from the API for billing. It lists all times tracked from all users to manage them by tags for creating invoices (for example set them "billed" and other tags).
This and other specifics are not possible in ClickUp so far.
Problem:
For such time entry applications it's currently not possible to retrieve all time entries from all users without iterating over the user list (with additional api calls) before!
The behaviour described at https://jsapi.apiary.io/apis/clickup20/reference/0/time-tracking-20/get-time-entries-within-a-date-range.html is problematic as long as there is no way to leave out assignee=XXX to get all users time entries.
I guess there are two options:
- Add antoher GET request without that assignee= restriction returning the results for all users
- Add a placeholder for assignee= like "ALL" - which would not conflic with the current solution, as it expects an integer. But I'm not sure if that's clean.
Anyway the current solution is not good and API consuming because you need a lot more API calls for the simple result. Ohter ClickUp APIs behave differently here!
Log In
Brendan W
complete
We recently updated our Time Tracking 2.0 API!
We now include the ability to request task, List, Folder, and Space ids and names, along with task tags when using the Get time entries within a date range and get singular time entry endpoints.
You can also filter results by task, List, Folder, or Space using the new parameters on the Get time entries within a date range endpoint.
Refer to our API documentation for more details!
Julian Pustkuchen
Brendan Wolfe: Thank you very much! This is great news, but I guess this particular request hast to be reopened due to the following reasons, which I guess are also valid for other time tracking applications:
This request is about the "assignee" value and behaviour.
The documentation on https://jsapi.apiary.io/apis/clickup20/reference/0/time-tracking-20/get-time-entries-within-a-date-range.html says:
"Not passing in any optional parameters will result in all time entries for the given user within the past 30 days. The given user is determined by their authentication method: either by their personal API token or OAuth. If your timer entry is attached a task that uses custom task ids you can expect a custom_id field in the body of the response. A task field will only show up if there is a task associated with a timer entry."
Please re-read the issue description and compare it to the documentation on the API page and what the API currently does.
Do you agree this is not solved yet or is there any misunderstanding or is the documentation simply wrong with these sentences?
I think it's sadly still required to loop users in separate calls to provide them as parameter(s) to the assignee value?
Please also see my comment below, it would be very valuable to be able to filter for the "billable" status. While this might be easy to add to the API, and I hope you agree makes sense for time tracking entries, it hasn't been implemented or documented yet?
I'd like to explain the simple, but typical use case to make it easier to understand why I think this is not an edge-case:
The business problem we need to solve through the API is to create invoices for the billable time.
Therefor we need time entries which match
- billable=true
- assignee=all users
- within given time range
- no "billed" time entry tag
typically for the whole workspace!
So we can invoice them and set then "billed" afterwards. Currently we do this via a tag, which is OK, but not perfect. Another problem for this case is that you can neither filter time entry "tagged with" currently nor for "not tagged with"!
So let me sum up, what's still missing in the API for a billing use case:
- Filter by "billable" status
- Retrieve result for ALL users (not just current or listed)
- Filter Time Entry Tags (also with NOT filter)
The last point is closely related to:
which would be even better than the current "billed" tag and perhaps more simple to filter.
So could you perhaps reopen this issue and pass this comment to a developer as follow-up to the latest changes? Perhaps parts of it might be simple to add now?
Thanks a lot!
Julian Pustkuchen
Brendan W: Sorry I guess the mention was broken by my edit? Hope you got my reply :(
Julian Pustkuchen
Brendan W: Did you read my comment? Could you please reopen this?
Julian Pustkuchen
Also it would be very helpful to filter the time entries for tags and billed status. I even think for most use cases of billing software this is urgently needed!
Technically spoken in:
- Add filter for billed / unbilled
- Add filter for "has tag"
- Allow to return the values for all users, not only listed users or current user (see above)