# Finding unassigned tasks with HistoricTaskInstanceQuery

**URL:** <https://forum.flowable.org/t/finding-unassigned-tasks-with-historictaskinstancequery/6417>\
**Category:** Flowable Engine\
**Created:** [July 22, 2020, 5:31am UTC](https://forum.flowable.org/t/finding-unassigned-tasks-with-historictaskinstancequery/6417 "2020-07-22T05:31:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dliotev](https://avatars.discourse-cdn.com/v4/letter/d/9dc877/32.png) [@dliotev](https://forum.flowable.org/u/dliotev)\
**Post date:** [July 22, 2020, 5:31am UTC](https://forum.flowable.org/t/finding-unassigned-tasks-with-historictaskinstancequery/6417/1 "2020-07-22T05:31:07Z")

</div>

How can I get all unassigned historic task Instances, in other words, all tasks where ‘assignee\_’ in table ACT\_HI\_TASKINST is null?

I tried using org.flowable.task.api.history.HistoricTaskInstanceQuery. There is the method taskAssignee(Sting) there, I tried passing null to it, but it does not work.

There is a ‘taskUnassigned()’ method in org.flowable.task.api.TaskQuery, but I am not sure if I can use it together with HistoricTaskInstanceQuery. It would be nice if the latter also had such a method.

---

<div class="post-metadata">

**Author:** ![filiphr](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/filiphr/32/315_2.png) [@filiphr](https://forum.flowable.org/u/filiphr)\
**Post date:** [July 22, 2020, 6:13am UTC](https://forum.flowable.org/t/finding-unassigned-tasks-with-historictaskinstancequery/6417/2 "2020-07-22T06:13:10Z")

</div>

Hey @dliotev,

Seems like `taskUnassigned()` is not exposed in the `HistoricTaskInstanceQuery`, you are free to provide a PR and move that method to the `TaskInfoQuery` (which is shared between the runtime and historic query).

That said you can use the `TaskQuery` if you need to as well. The runtime tasks are a subset of the historic tasks and contains only tasks which have not been completed. I am fairly certain that you are interested in getting not finished unassigned tasks.

Cheers,  
Filip

---

<div class="post-metadata">

**Author:** ![dliotev](https://avatars.discourse-cdn.com/v4/letter/d/9dc877/32.png) [@dliotev](https://forum.flowable.org/u/dliotev)\
**Post date:** [July 22, 2020, 9:18am UTC](https://forum.flowable.org/t/finding-unassigned-tasks-with-historictaskinstancequery/6417/3 "2020-07-22T09:18:25Z")

</div>

Thanks Filip, I guess I will try moving the method.
