# Take next task automatically

**URL:** <https://community.ofelia.com/t/take-next-task-automatically/8115>\
**Category:** Q&A\
**Created:** [18 January 2017 18:59 UTC](https://community.ofelia.com/t/take-next-task-automatically/8115 "2017-01-18T18:59:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zibek8](https://avatars.discourse-cdn.com/v4/letter/z/aca169/32.png) [@zibek8](https://community.ofelia.com/u/zibek8)\
**Post date:** [18 January 2017 18:59 UTC](https://community.ofelia.com/t/take-next-task-automatically/8115/1 "2017-01-18T18:59:38Z")

</div>

Hi. I have been using Bonita bpm about a month, and I was wondering if it is possible to make a task to be taken automatically to the current user.  
I am using the most recent version of Bonita BPM, and as far as I know, a user must click on the “Take” button to take the next task. I am currently working on a project that has many steps, and it is a little bit annoying that you have to click the Take button each time to take the next task.  
So, is there any way to make the next task to be taken automatically to the current user?  
Thank you.

---

<div class="post-metadata">

**Author:** ![Sean\_McP](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/sean_mcp/32/932_2.png) [@Sean\_McP](https://community.ofelia.com/u/Sean_McP)\
**Post date:** [18 January 2017 19:27 UTC](https://community.ofelia.com/t/take-next-task-automatically/8115/2 "2017-01-18T19:27:56Z")

</div>

Yes there is a way, however this “sort of” defeats the objective of Actors and the like who may do a job function.

That being said, we also have need to assign to specific users tasks…

You need to use:

`
processAPI.assignUserTask(activityId, userid.getId());
`

where activityId is the id of the pending HumanTaskInstance.

_Note: I can’t publish the specific code we use for company reasons, this though points you in the right direction._

regards  
Seán

_PS: While this may not be the complete answer you’re hoping for, it does indicate a possible solution, please mark as resolved._

---

<div class="post-metadata">

**Author:** ![zibek8](https://avatars.discourse-cdn.com/v4/letter/z/aca169/32.png) [@zibek8](https://community.ofelia.com/u/zibek8)\
**Post date:** [18 January 2017 20:04 UTC](https://community.ofelia.com/t/take-next-task-automatically/8115/3 "2017-01-18T20:04:45Z")

</div>

Thank you for the answer. So, I guess I should use assignUserTask in the connectors using Groovy script, am I right?

---

<div class="post-metadata">

**Author:** ![Sean\_McP](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/sean_mcp/32/932_2.png) [@Sean\_McP](https://community.ofelia.com/u/Sean_McP)\
**Post date:** [18 January 2017 21:31 UTC](https://community.ofelia.com/t/take-next-task-automatically/8115/4 "2017-01-18T21:31:32Z")

</div>

Yep…that’s exactly how we use it…

🙂

---

<div class="post-metadata">

**Author:** ![romualdo.s.rs](https://avatars.discourse-cdn.com/v4/letter/r/9fc348/32.png) [@romualdo.s.rs](https://community.ofelia.com/u/romualdo.s.rs)\
**Post date:** [20 June 2017 12:42 UTC](https://community.ofelia.com/t/take-next-task-automatically/8115/5 "2017-06-20T12:42:22Z")

</div>

Good Morning,

I am exactly with the same problem, and I could not solve with just the above explanation, did you solve your problem? Could you give me a tip?

---

<div class="post-metadata">

**Author:** ![romualdo.s.rs](https://avatars.discourse-cdn.com/v4/letter/r/9fc348/32.png) [@romualdo.s.rs](https://community.ofelia.com/u/romualdo.s.rs)\
**Post date:** [20 June 2017 12:42 UTC](https://community.ofelia.com/t/take-next-task-automatically/8115/6 "2017-06-20T12:42:27Z")

</div>

Good Morning,

I am exactly with the same problem, and I could not solve with just the above explanation, did you solve your problem? Could you give me a tip?
