You can retrieve the parent event, along with it’s process, stages and tasks via a Variable assyst Search field. To get the tasks when retrieving the event set the ‘fields’ attribute to ‘process.stages.tasks.taskEvent’
You can then use an expression to calculate the event Id to use for the close action that you need to take to progress the workflow.
The expression will need to walk the process tree to find the active stage, and within that the relevant task.
Something (untested) like:
var activeStage = variables.parentEvent.process.stages.fillter(function(s){return s.stageStateEnum == 'ACTIVE'})=0];
Will find the active stage, and something similar can be used to find the task within the active stage.