Hey, I am trying to fetch all worklogs within a date range. Since I think that it is natively not possible to do that, my process was to fetch issues and then its corresponding worklogs.
However, the search endpoint: /rest/api/2/search with the following body does not return the result I expected.
Body =
Worklog: StartDate 06/10/2024 08:00:00, UpdatedDate: 07/01/2024 11:41:24, CreatedDate: 07/01/2024 11:41:20
The value of "StartDate" differs in every worklog (which is kind of obvious), but the UpdatedDate and CreatedDate are almost every time the start of the next month (also intended). The confusing part here is that every other issue is being returned, regardless of the difference in the months of StartDate and the other dates. It is just this one single issue which will not be returned. The problem might also not be the date itself, I am not sure.
As an example, another issue with the following data is being returned, using the exact same jql query.
Worklog: StartDate 06/24/2024 08:00:00, UpdatedDate: 07/01/2024 11:47:31, CreatedDate: 07/01/2024 11:47:31
I know that this endpoint returns all the issues, where a single worklog within the issue satisfies the condition, which means I will get worklogs even though they do not match the condition. But I still think that given those specific worklogs, the missing issue should be returned..
Am I missing something?
most likely, the issue is that Jira doesn't index an unlimited number of worklogs: https://community.atlassian.com/t5/Data-Center-articles/Introducing-Safeguards-for-Jira-index/ba-p/2037880#M433
Hi @Eren Erdem welcome to the Community!
First of all, change your jql as following, in order not to miss the worklogs on end date:
worklogDate >= 2024-06-01 AND worklogDate < 2024-07-01
And for the dates:
So, when you are searching through worklogDate, it is looking at the StartDate for the worklog.
With this knowledge, I think your approach is correct. So, can you please share some more details about your setup:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the quick reply.
As for the questions:
I do see every issue that I want to request in the UI when I am logged in. In fact, all 155 worklogs, at which the month of the start date is equal to June (the month the jql query requests filters) are available.
I am 100% positive about 49 issues.
Worklogs which ARE in the response:
[13:37:31 INF] Jira key: "GJT-8361", Worklogs: 4
[13:37:31 INF] Worklog: 06/04/2024 08:00:00
[13:37:31 INF] Worklog: 06/05/2024 08:00:00
[13:37:31 INF] Worklog: 06/06/2024 08:00:00
[13:37:31 INF] Worklog: 06/07/2024 08:00:00
Worklogs in the missing / invisible issue:
[13:41:59 INF] Jira key: "NIT-2316", Worklogs: 155
[13:41:59 INF] Worklog: StartDate 06/03/2024 08:00:00
...
[13:41:59 INF] Worklog: StartDate 06/03/2024 08:00:00
[13:41:59 INF] Worklog: StartDate 06/04/2024 08:00:00
[13:41:59 INF] Worklog: StartDate 06/04/2024 08:00:00
[13:41:59 INF] Worklog: StartDate 06/05/2024 08:00:00
[13:41:59 INF] Worklog: StartDate 06/05/2024 08:00:00
...
[13:41:59 INF] Worklog: StartDate 06/10/2024 08:00:00
[13:41:59 INF] Worklog: StartDate 06/14/2024 08:00:00
[13:41:59 INF] Worklog: StartDate 06/24/2024 08:00:00
...
[13:41:59 INF] Worklog: StartDate 06/28/2024 08:00:00
....
155 worklogs instead of the 1k+ because I filter them once more AFTER I fetch them, since I want to have the actual worklogs within the date range, and not every worklog in the issue (i elaborated that above)
Yeah, again, I do not see a problem here...
EDIT:
One more thing: If I request issues a month later (for July), I DO get the missing issue, since it has worklogs where the StartDate fits within the date range, but so should it do in June, but it doesn't.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I now found out that the endpoint does not return the issue up until June 2024, after June, it returns the issue. So no issue in January, February, ... although the issue contains data where the StartDate satisfies the date range.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.