Cannot read property 'taskName' of undefined

When making a IVR test call, I keep seeing the below in the debug log.
Cannot read property 'taskName' of undefined
I see this in the script node I created but doesn’t give me the reason why it took such error and there’s no description of the issue, besides I didn’t create any variable as taskName.

@Venkat

  • Can you please copy paste the script node content?
  • Also, for IVR, you will usually need a task/ message associated with welcome event to be associated. Do you have it configured?

@swagata.sengupta To answer your question, yes the script node content does not have any variable defined and for IVR, the configuration is already in place for the task.
Thanks.

@swagata.sengupta
After a lot of digging through I got to know that it’s coming from the condition I’m checking, see below. After commenting it out the issue seems to have been resolved.

if(context.endOfTask !== "" && context.endOfTask.taskName !== "" && context.endOfTask.taskName === 'Transfer To Agent') {
print(getPrompt('Blah'));
}

But the solution for this would be in place only when it sees taskName from the context which would be coming from another bot. We have figured that out.
Thank you.