I have a json file, which is stored in an environment variable temp.
{ \"users\": [ { \"username\": \"jack\", \"email\": \"jack@somewhere.com\",
You need to quote your column names, especially since they contain spaces and dashes. However you need to escape the quotes for bash:
jq --raw-output '.users[] | [.username, .email, ."total running apps", ."api-mock-app", ."flogo", ."ipaas", ."nodejs-app"] | @csv'