Retrieving task list without the need for multiple calls

Hi everyone
I need to search for specific user’s task list and then group them by process definition name and then by process instance. Is there a way without multiple calls and joins? I was thinking of adding custom metadata attributes to the task so I can get them in one api call. Is there a way to achieve such thing?

hi!

you can get all the tasks and then group them by using java streams api.

Thanks Moshell!
The task has only IDs, definition id and instance id. Can I get the names in one call or I need to loop over the tasks and get the information one by one? That’s why I’m asking if I can have custom metadata or other solution. I have also one variable where I’m manually setting progress in each task. I need to retrieve by iterating on tasks. If there is a way to add custom data it will be easy to get them with the task query at once.

hi @TJaber

you can do something like this

hope it helps you

Interesting!
I’ll try it and post here the result.
Many thanks for the help and support!