CXone Studio ASSIGN variable scope issue in nested IF branches

I’m running into a weird scoping issue with custom attributes in CXone Studio. I have a script that needs to route based on whether a customer has an active case in our CRM.

I’m using GetRESTProxy to hit our internal API. That part works fine. The JSON response comes back clean. Here’s the setup:

GET /api/v1/cases?phone=${user.phone}

The response looks like this:

{
 "has_case": true,
 "case_id": "12345"
}

I have an ASSIGN action right after the proxy call:

ASSIGN user.has_active_case = ${rest_response.body.has_case}

Then I have an IF block to check that value:

IF ${user.has_active_case} == true
 THEN Route to Queue A
ELSE
 THEN Route to Queue B
END IF

The problem is that ${user.has_active_case} is coming up as null or empty inside the IF condition, even though I can see in the session trace that the ASSIGN executed successfully. It’s like the variable isn’t persisting across the boundary into the conditional logic.

I’ve tried:

  1. Using a session variable instead of a user attribute (session.has_case). Same result.
  2. Moving the ASSIGN into the IF condition directly (IF ${rest_response.body.has_case} == true). This works, but I need to reuse the logic in multiple places, so I don’t want to duplicate the REST call.
  3. Checking for string “true” instead of boolean true.

The session trace shows the ASSIGN action completing with no errors. The value is definitely set. But the IF action seems to evaluate it as empty.

Is there a known limitation with referencing user attributes in IF conditions immediately after an ASSIGN in the same block? Or am I missing something obvious about how Studio evaluates these expressions?