Task assignment API call unassign task instead

Hi!

I’m doing some tests with the API and I’m having trouble with the “Set assignee” call (https://docs.camunda.org/manual/7.8/reference/rest/task/post-assignee/). After calling it and finish successfully, the task is unassigned, and I have to reclaim it again.

This is the method I’m using to reassign the task:

        $scope.assignTask = function(userId) {
            return $http.post(Uri.appUri('engine://engine/:engine/task/' + camForm.taskId + '/assignee'), {
                headers: {
                    'Content-Type': "application/json;charset=utf-8"
                },
                body: {
                    'userId': userId
                }
            });
        }

Am I missing something?

Thanks,

Hi @felipRR,

Make sure that the passed useId has a value… try to print it before the post request.

Hi!

The userId has a the correct value. In fact, it works fine but it was me that wasn’t understand correctly what it was doing. Actually, Camunda is assigning the user to the task, BUT then the task is finished and start the next one. What I’d need is that the user is assigned to the newly started task, not the one that we complete.

Cheers,