ID of the previous task

We need to send a mail message on task create event with summary from previous task (wich completion caused the current task to be created).

Did’t find any parameters in task model, or any API methods to get this information.

Is there any simple solutions to get the previous task ID?

From the top of my head, I can think of this query:
https://docs.camunda.org/manual/7.11/reference/rest/history/task/get-task-query/
with the parameters like so:

processInstanceId: <your process Instance ID>;
finished: true; 
sortBy: endDate; 
sortOrder: desc; 
maxResults: 1

This should get you the most recently finished Task in the process Instance. Maybe someone can come up with a more elegant solution :slight_smile: