If I understand correctly you've given aliasses to specific values? Tableau returns the exact values instead of the aliasses in your js call?
If that's the case, you could try to create a calculated field (instead of the aliasses) and return that.
Thank you for replying. Let me give this a try.