Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Recommended way to get my own worklogs through the REST API

Adrian Fahrbach
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
Oct 24, 2023

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:

  1. Get all worklog ids using `/rest/api/3/worklog/updated`
  2. Send all of those ids to `/rest/api/3/worklog/list`
  3. Filter the result of the previous call by author

 

So my questions are:

  1. Do I really need to make two calls and filter them on my own or is there some kind of filter property hidden somewhere?
  2. Is there a way to sort `/rest/api/3/worklog/updated` to get the latest logs first or do I really have to loop through all pages until I reached the end?

1 answer

1 vote
David Bakkers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 24, 2023 • edited

"Do I really need to make two calls and filter them on my own"

Yep

"Do I really have to loop through all pages until I reached the end?"

Yep

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.

Have fun.

Adrian Fahrbach
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
Oct 25, 2023

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.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events