cancel
Showing results for 
Search instead for 
Did you mean: 

How Get reassign and involved People history for task?

shaparak-smmira
Champ in-the-making
Champ in-the-making
hi to all

I want to get  reassign and involved People history for task,like that in actiivti-explorer that name is events in right panel of tasks
I use historyservice for this but I cant find suitable query for this .

plz help me for this
11 REPLIES 11

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Reassigning is done via the taskservice. Changing things in the historytable is falcification and not advised…

shaparak-smmira
Champ in-the-making
Champ in-the-making
thanks ronald.van.kuijk for your answer

but I  dont have to made change in history table ,i want to get history of assinging task .
like in activiti-explorer, when you reassign task or involved people ,in right panel "Events" show comment:
"Kermit The Frog involved Fozzie Bear as assignee 4 hours ago""

I need code for return this….

frederikherema1
Star Contributor
Star Contributor
This is stored as a special type of "Comment" in the history (ACT_HI_COMMENT). Use the appropriate API's to fetch these…

shaparak-smmira
Champ in-the-making
Champ in-the-making
thanks a lot

i know it ,but I dont find suitable query for this .
i thick must use historyservice for this case,but i dont have any approach for do it!

plz help me for this?

jbarrez
Star Contributor
Star Contributor
List<Comment> getTaskComments(String taskId) on TaskService.

However, the api to delete a comment is not exposed. You'll need to add your own custom command to do this (I've answered this question already a few times here).

thestrazz
Champ in-the-making
Champ in-the-making
List<Comment> getTaskComments(String taskId) on TaskService.

However, the api to delete a comment is not exposed. You'll need to add your own custom command to do this (I've answered this question already a few times here).

I Have found the "reassign" event via TaskService#getTaskEvent(String taskId) but the message contains only "null_|_assignee", where i can find the information about the new Assigee?

shaparak-smmira
Champ in-the-making
Champ in-the-making
thank you a lot  jbarrez

that is help me a lot,

I use taskService.setAssignee(task.getId(), "kermit") for reassign task to User ,it is worked
but in table "act_hi_comment" UserId is null ,what s problem?

jbarrez
Star Contributor
Star Contributor
Hmm that is probably because the commenting uses the current user:

try to do this:

try {
  identityService.setAuthenticatedUserId("Joram");
  … // your logic
} finally {
  identityService.setAuthenticatedUserId(null);
}

thestrazz
Champ in-the-making
Champ in-the-making
Hmm that is probably because the commenting uses the current user:

try to do this:

try {
  identityService.setAuthenticatedUserId("Joram");
  … // your logic
} finally {
  identityService.setAuthenticatedUserId(null);
}

It works! Thank you very much!