You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I'm trying to get all of my worklogs with details through the JIRA API and I'm not quite sure if my approach is correct. It seems very counter intuitiv:
So my questions are:
"Do I really need to make two calls and filter them on my own"
"Do I really have to loop through all pages until I reached the end?"
Welcome to the tedious world of pulling down Issue worklogs, returned in fixed chronological order :)
Use the startedAfter, startedBefore or since parameters in your queries to restrict the time range of the events to make your result set smaller, but you'll still have to deal with any pagination for large sets.
I actually found a "better" way to do it.
I'm searching for issues with JQL using the search endpoint and this query:
`worklogAuthor = %AUTHOR_ID% AND worklogDate > %DATE%`
With `"fields": ["worklog"]` it is possible to get the worklogs in the same call.
This leads to a loot of looping through paginations in there, but this way I usually have to use less calls and don't run in to issues on larger Jira instances.