TaskId Null in historic variable instances

Hi Everyone,
I am trying to fetch the variables of a closed process using

But the taskId which i get in response is null.
I also looked up at the database table act_hi_varinst.
The taskId in null in the DB too.

Is it correct or I have missed something?
I would like to know the taskId from which the variable was submitted?

@aravindhrs @Niall
Any hints on this will be highly appreciated?

@Mass_Shake, If the variables are process variables then the variable instance will have process instance id only. If the variables are task variables you can see TaskId also in the variable instances. Two types of variables exist in camunda: process variables and task variables

Yes,but the variables were submitted through User Task by ReST API.So should it not have taskId associated with it?

I am also having the same problem… I have a Process ID but no TaskID is generated by Camunda ?

Hi @Mass_Shake,

In case user task is completed and submitted variables don’t exist in any scope then they get created in process instance scope so there would be no task Id related to them.

If there is a need to have variables created in other scopes (execution or task scope) then they have to be created explicitly as local variables in the intended scope.