Running into a weird issue with a script update. The logic seems to skip the first IF block entirely when the interaction starts. We are trying to route calls based on a JSON payload from a webhook. The goal is simple. If the priority field is high, set a disposition code. Otherwise, route to general queue.
Here is the I wrote:
ASSIGN priority = JSON.parse(body).priority
IF priority == "high"
ASSIGN disposition = "URGENT"
ELSE
ASSIGN disposition = "NORMAL"
END IF
I added a DEBUG action right after the ASSIGN to log the priority value. The log shows high correctly. But the IF block never triggers the URGENT assignment. It always falls through to the ELSE. I tried changing the comparison to IF priority contains "high" but that didn’t help either. The script runs without errors. No red flags in the error logs. Just silent failure of the conditional logic. Is there a timing issue with JSON parsing in ? Or am I missing something obvious about how ASSIGN works with dynamic data? The script is deployed to the prod environment. Same behavior in sandbox.