# How to get a Task assigned date and Task Completed Date

**URL:** <https://community.ofelia.com/t/how-to-get-a-task-assigned-date-and-task-completed-date/9770>\
**Category:** Q&A\
**Tags:** bonita-studio\
**Created:** [11 August 2019 08:36 UTC](https://community.ofelia.com/t/how-to-get-a-task-assigned-date-and-task-completed-date/9770 "2019-08-11T08:36:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dibyajit.Roy](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@Dibyajit.Roy](https://community.ofelia.com/u/Dibyajit.Roy)\
**Post date:** [11 August 2019 08:36 UTC](https://community.ofelia.com/t/how-to-get-a-task-assigned-date-and-task-completed-date/9770/1 "2019-08-11T08:36:41Z")

</div>

Hi Community

I am trying to save the Details for each task. I need to collect 3 information for each task.

1. The date when the task was available to the group.
2. The Date when an approver has picked up the task
3. The Date when the Task was completed.

The available rest api shows the 1 and 3 Dates. not the 2 date.

Could Somebody suggest how I can proceed here.  
Also is there any way to track if a user has accepted a task and then released it.  
Could we use a groovy script to fetch these details and store in Database .

Thanks in Advance.

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/community_bonitasoft/original/2X/6/6b7b18c0478f2645369e82e009b65e3b97f2cc12.svg) [@system](https://community.ofelia.com/u/system)\
**Post date:** [30 August 2019 13:31 UTC](https://community.ofelia.com/t/how-to-get-a-task-assigned-date-and-task-completed-date/9770/2 "2019-08-30T13:31:26Z")

</div>

Hi Dibyajit,

When you want to collect information from tasks in the REST API, you have 2 ways to do it :

- Requesting in HumanTask API (bpmAPI)
- Requesting in ArchivedHumanTask API (bpmAPI)

Here is the link to [bpmAPI documentation](https://documentation.bonitasoft.com/bonita/7.9/bpm-api) .

HumanTask will give you data related to ongoing process instances whereas ArchivedHumanTask is related to all archived data on completed tasks.

To collect your information, you can use “reached\_state\_date” object which gives you the date when your task reaches a certain state. The states are « ready » « completed » «failed» for both HumanTask and ArchivedHumanTask

1. You use “assigned\_date” (from HumanTask or ArchivedHumanTask depending on what you want to do with the data) to get the date when the task is available
2. You will request »reach\_state\_date » as « ready » and the value of “executedBy” to get the date and the name of the person who has executed the task
3. And to get the date when your task has been completed, use reach\_state\_date as « completed » in archivedHumanTask

For my information, how do you want to use this data ?

To answer your second question, as of today we have no data historization system for task assignment. Therefore you will only be able to see the last state and assignee.  
Nevertheless, case overview page displays part of the REST API data

---

<div class="post-metadata">

**Author:** ![dke](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@dke](https://community.ofelia.com/u/dke)\
**Post date:** [7 November 2023 17:37 UTC](https://community.ofelia.com/t/how-to-get-a-task-assigned-date-and-task-completed-date/9770/3 "2023-11-07T17:37:54Z")

</div>

Hi,

Throught the operation's script I tried to get the assigned date of a human task without success.

I success to get the human task with the id but with the apiAccessor we don't have any access of this date.

There is a way to retrieve this information ?

&nbsp;

Thanks

---

<div class="post-metadata">

**Author:** ![Dibyajit.Roy](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@Dibyajit.Roy](https://community.ofelia.com/u/Dibyajit.Roy)\
**Post date:** [5 September 2019 06:30 UTC](https://community.ofelia.com/t/how-to-get-a-task-assigned-date-and-task-completed-date/9770/4 "2019-09-05T06:30:04Z")

</div>

Thank you Delphine.  
I will definitely check it out.
