CXone Studio: IF action failing on dynamic string comparison within ASSIGN block

Working on a Studio script that needs to route calls based on a dynamic status code pulled from an external API. The goal is simple: fetch the JSON, parse the status, and branch logic accordingly.

The issue is the IF action isn’t evaluating correctly when comparing the parsed variable against a string literal. It always falls to the else branch, even when the values match visually in the debug output.

Here is the snippet:

GetRESTProxy
 Method: GET
 URL: https://api.internal/status?id={{customer.id}}
 Store Response: statusResponse

ASSIGN
 Source: statusResponse.body.status_code
 Target: currentStatus
 Type: String

IF
 Condition: {{currentStatus}} == "ACTIVE"
 True Branch: Route to Agent Group A
 False Branch: Route to Agent Group B

Debugging shows currentStatus holds the value “ACTIVE”. No quotes in the value itself, just raw text. I’ve tried wrapping the literal in quotes in the condition. I’ve tried using Equals function explicitly. I even tried trimming whitespace with Trim() in the ASSIGN step just in case. None of it works. The condition evaluates to false every single time.

Is there a hidden type casting issue with how Studio handles strings from REST proxies? The documentation for IF actions is pretty thin on data type enforcement. I’m assuming the REST response is a string, but maybe it’s coming in as an integer or something weird that breaks the == operator?

Also tried using the StartsWith function just to be safe. Still fails. The only thing that works is hardcoding the value in the ASSIGN step, which defeats the purpose.

Any ideas on how to force a string comparison in this context? Or is there a better way to parse the JSON body directly in the IF condition without the intermediate ASSIGN?

Running out of places to look. The script is stuck in a loop of false negatives.