How can get the user initiate process from task list?

I’m using rest api camunda to retive array json of tasks /engine-rest/task how can get the initiator of this process (how start this process)?

[{ "id": "9af2e214-0f2b-11e9-a1b9-0242ac11001a", "name": "Check Data\n", "assignee": "anas", "created": "2019-01-03T07:45:56.000+0000", "due": null, "followUp": null, "delegationState": null, "description": null, "executionId": "992f39fe-0f2b-11e9-a1b9-0242ac11001a", "owner": null, "parentTaskId": null, "priority": 50, "processDefinitionId": "checkProcess:12:931a36e8-0c26-11e9-947f-0242ac11001a", "processInstanceId": "992f39fe-0f2b-11e9-a1b9-0242ac11001a", "taskDefinitionKey": "check Data", "caseExecutionId": null, "caseInstanceId": null, "caseDefinitionId": null, "suspended": false, "formKey": "check Form", "tenantId": null },...]

Hi,

If I understand your question correctly, you want to find how started the process instance related to a specific task, please correct me if I am wrong.
From the result of /engine-rest/task you need to get the processInstanceId of the task and then you can query for it via /engine-rest/history/process-instance?processInstanceId=theProcessInstanceId.
In the result you will find startUserId - the id of the user who started the process instance.

For reference: https://docs.camunda.org/manual/develop/reference/rest/history/process-instance/get-process-instance-query/

@Yana thanks you for your response , yes that what i’m looking it.

only in this way can do it ? my concerns it’s i have page show all tasks assign for user so i use “/engine-rest/task” if i have to use **"/engine-rest/history/process-instance?processInstanceId=theProcessInstanceId" for each task overload hits !!!

Hi,

If you provide more details what are your goals, maybe we can think about another approach.
For example if you have limited number of users who can start a process instance, you can create a variable which store the initiator and later query by it.

1 Like