Question

Extract open child task id based on parent ticket id in ETM

  • 3 November 2022
  • 1 reply
  • 54 views

Badge +3

I have a business  case where ETM channel will receive a inbound email with Parent ticket no and I need to close the last open task of that ticket so it moved to the next stage of the workflow.

Just wondering if ETM data mapper can extract the last child open task number if I pass parent ticket id as parameter.


1 reply

Userlevel 2
Badge +9

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.

 

Reply