# How can I update a active task due date

**URL:** <https://forum.flowable.org/t/how-can-i-update-a-active-task-due-date/1499>\
**Category:** Flowable Engine\
**Created:** [January 25, 2018, 12:13pm UTC](https://forum.flowable.org/t/how-can-i-update-a-active-task-due-date/1499 "2018-01-25T12:13:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![amitshukla](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@amitshukla](https://forum.flowable.org/u/amitshukla)\
**Post date:** [January 25, 2018, 12:13pm UTC](https://forum.flowable.org/t/how-can-i-update-a-active-task-due-date/1499/1 "2018-01-25T12:13:41Z")

</div>

I have created a task and assigned to user with due date set. User wants an extension. How to update the task with due date for a task ID??

I have been trying this but not working

```
TaskEntity oldTask = (TaskEntity) taskService.newTask(taskId);
oldTask.setDueDate(dueDate);

```

When I add

`taskService.saveTask(oldTask);`

It gives fatal error of Duplicate Primary Key for task ID passed. I think it is trying to create a new task with same task ID but I want to update.

I need help. Please guide me.

Awaiting for a response.

Thanks.

---

<div class="post-metadata">

**Author:** ![martin.grofcik](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/martin.grofcik/32/71_2.png) [@martin.grofcik](https://forum.flowable.org/u/martin.grofcik)\
**Post date:** [January 25, 2018, 12:34pm UTC](https://forum.flowable.org/t/how-can-i-update-a-active-task-due-date/1499/2 "2018-01-25T12:34:10Z")

</div>

Hi,

use:  
TaskServicel#setDueDate

Martin

---

<div class="post-metadata">

**Author:** ![amitshukla](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@amitshukla](https://forum.flowable.org/u/amitshukla)\
**Post date:** [January 29, 2018, 4:11am UTC](https://forum.flowable.org/t/how-can-i-update-a-active-task-due-date/1499/3 "2018-01-29T04:11:51Z")

</div>

Thanks martin. It worked.
