Task history: query for tasks completed within x-days

Hello

Is there a way to query for completed tasks within a given start and end date? Currently the history service allows you to query for tasks based on due date or follow update but no way to query by start and end date. I know I can use native query but my query becomes complicated if i want to query also by candidate group etc.

I’m surprised there isn’t something in the HistoryService to narrow down completed tasks based on core dates.

Any help would be appreciated.

Hi @aminmc,

indeed I don’t see any API methods related to start\end data in HistoricTaskInstanceQuery, but HistoricActivityInstanceQuery has start and end date filters. May be you could use that? Since historic activity instances have task id in them it should be possible.

Cheers,
Askar

Hi there

Thanks for your reply. The issue with HistoricActivityInstanceQuery is that it doesn’t give me the option to filter by candidateGroup, unless I’ve missed the option. I’m trying to avoid the need to do 2 queries.

Cheers

Hi @aminmc,

right now there is no support for that in API, you can always create a ticket in our JIRA and even provide a pull request with implementaition if you would like to have that feature faster in the product.

I hope that helps you,
Askar

Hi there

I’ve raised a JIRA for this feature:

https://app.camunda.com/jira/browse/CAM-7835

I’ll start looking at creating a PR for this feature.

Thanks

PR: https://github.com/camunda/camunda-bpm-platform/pull/271

Hi @aakhmerov

I noticed an alpha release but didn’t see CAM-7835 listed in the release notes. Can you confirm if that fix is present in the release?

Thanks

Hi @aminmc,

the issue was solved in alpha1 so it is not part of the release notes of alpha2.

Please see the release notes of alpha1.

Cheers,
Tassilo

@tasso94 Sorry about that! Thanks