christianrondeau / jira-toggl-sync

A simple tool to synchronize Toggl time entries into Atlassian JIRA's work log entries
9 stars 6 forks source link

toggl time entries are limited to 1000 #14

Open nathaniel-holder opened 6 years ago

nathaniel-holder commented 6 years ago

The syncDays configuration value, if set too high, will result in hitting the toggle API limit of only returning 1000 time entries. As the toggl API suggests, a paginated call to the alternate API command detailed report allows for unlimited time log entries.

christianrondeau commented 6 years ago

That makes sense, we could do paging but I'm wondering: if you're synchronizing more than a thousand time tracking entries, won't that take forever? Unless you're just trying to do a batch import? I'd like to better understand your use case.

This was not designed for batch importing, but could very well be adapted to be.

nathaniel-holder commented 6 years ago

I set the {{syncDays}} config to something like 365 to account for any manual changes to toggl time entries going back a year. It's an unlikely scenario for me, but wanted to allow for back-dated modifications to toggl. The time it takes to run isn't really a problem for me.

My use case only required 10 days of batch syncing, but I definitely see the need for batch import if I had been using toggl for a long time on a Jira project and had been syncing manually and wanted to make sure those work log entries were correct.

christianrondeau commented 6 years ago

I understand, that makes sense. This is something we didn't need, but I'd accept a PR if that's useful for you. This being said, the Toggl API submodule is really outdated, so you may need to replace it by HttpClient json calls.

nathaniel-holder commented 6 years ago

Thanks, I probably won't get to it any time soon.

christianrondeau commented 6 years ago

Me neither ;)