cancel
Showing results for 
Search instead for 
Did you mean: 

Reassign a task

skverma02
Confirmed Champ
Confirmed Champ

can we reassign a task to someone else user?

lets assume a task is assign to "user A" and we want to assign this task to "user B"  

I am using query to assign a task to "user A " is 

query is

 {"action":"claim","assignee":"userIdA"}

and rest url is 

http://localhost:8080/activiti-rest/service/runtime/tasks/taskId

how can assign this task to user B?

1 ACCEPTED ANSWER

bassam_al-saror
Star Collaborator
Star Collaborator

A task can be updated using the following endpoint Activiti User Guide. This includes updating the assignee

POST /runtime/tasks/{taskId}

{

"assignee": "userIdB"

}

View answer in original post

8 REPLIES 8

skverma02
Confirmed Champ
Confirmed Champ

we must call the two REST APIs in order.

 

1. unclaim

POST runtime/tasks/%taskId%

{
"action": "claim",
"assignee": null
}

 

2. claim

POST runtime/tasks/%taskId%

{
"action": "claim",
"assignee": %userId%
}

 

Reference

15.7.5. Task actions

Activiti User Guide 

bassam_al-saror
Star Collaborator
Star Collaborator

A task can be updated using the following endpoint Activiti User Guide. This includes updating the assignee

POST /runtime/tasks/{taskId}

{

"assignee": "userIdB"

}

skverma02
Confirmed Champ
Confirmed Champ

‌ 

yes you are right .
but it is not post it is put.

thank you Smiley Happy

ltd89
Champ in-the-making
Champ in-the-making

Thanks for the solution.

As a follow-up question, what would you do if the original assignee (User A) was the process initiator, in which the subsequent tasks may be assigned to this person? What should I do to assign all future tasks that belong to User A to User B?