Rest API unassign task

1
0
-1

Hello,

In Rest API, How do I unassign a task to a user?

Thanks in advance Manolo

3 answers

1
0
-1

This is a truly annoying problem - try assigning 0, it fails. Try assigning 1, it also fails. Try sending a value of "null" it also fails. Any other number, except the userId it has been assigned to, it also fails.

However, it is actually possible. To reach the answer, you need to read the source code:

SHORT ANSWER: Send a put request to API/bpm/humanTask/:humanTaskId { assigned_id : "" }

The assigned ID must be an empty string. The validation tests that it is not null, and its length is greater than zero. If this holds, it checks that it is not being assigned to a different user than the one it is already assigned to, then throwing the infamous exception.

Since the update method takes a map of string to string, sending an empty string bypasses this stupid check, and yet updates the HumanTask just fine.

Link to relevant source file

1
0
-1

Why can we only unassign a task from the portal? there is any solution to this issue?

1
0
-1

I haven't done this yet but I suppose your key is the parameter state. I think the possible values for the state are: skipped | ready | completed | failed. Take a look here http://documentation.bonitasoft.com/bpm-api#humantask

Notifications