Rest API for adding owner,assigne,tenantId

Team,

through rest api i am starting the task . http://localhost:8090/engine-rest/process-definition/key/my_demo_1/start (post method with below variables )

{
“variables”:
{
“project_id”: {“value”: “101”},
“Stage”: {“value”: “L1”},
“Status”: {“value”: “In-Progress”}

} 

}
After GET method for below url
http://localhost:8090/engine-rest/task?processDefinitionKey=my_demo_1 - it showing below response
[
{
“id”: “902ad87b-1ebd-11e9-a0a7-36e12d236973”,
“name”: “L1-Approve”,
“assignee”: null,
“created”: “2019-01-23T08:48:32.789+0530”,
“due”: null,
“followUp”: null,
“delegationState”: null,
“description”: null,
“executionId”: “902ab160-1ebd-11e9-a0a7-36e12d236973”,
“owner”: null,
“parentTaskId”: null,
“priority”: 50,
“processDefinitionId”: “my_demo_1:1:1559ea9d-1ebc-11e9-a0a7-36e12d236973”,
“processInstanceId”: “902ab160-1ebd-11e9-a0a7-36e12d236973”,
“taskDefinitionKey”: “Task_1xz8kpk”,
“caseExecutionId”: null,
“caseInstanceId”: null,
“caseDefinitionId”: null,
“suspended”: false,
“formKey”: null,
“tenantId”: null
}
]

  • Question is how can i add owner ,assignee and other fields in the json … please help

Hi,

You cannot set explicitly the owner and tenantId of a task via rest api.
The tenantid is set depending if the process instance is started with specified tenant id of not. 1
In your case you start the process instance without tenant and you cannot adjust it only for the task.
If you want to set an assignee, please check the following rest endpoint 2
Finally, here are all of the rest endpoint for task 3