I omitted a few fields but the API call returns an array of subjects from those tickets, then I store them into the CASES variable which looks like this:
When I try to prompt the variable, it does not unfold the array, showing the whole variable as an entry. Note that if I manually go over the variables in settings and "remove and add the new line again" it works!
I'm surprised it isn't already. But I'd start by taking out CASES=$, the ) after subject', and the echo $CASES line from your shell script -- the output from jq can be saved straight to the KM CASES variable.
As @ccstone says -- CASES is a global variable. That can make it more difficult to see what's going on. Because you suppressed curl error messages with --silent you won't see them, but because the final echo command will always work your action will always be successful and you could be appending an empty string to the data already in CASES.