How can we set artifact "destinations" dynamically as a function of env vars or other things?

I just got artifacts working, which is great, but the problem is that when I download the artifact it always has the same name and I have to rename it to associate it with the name of the branch that it ran on. I’d really like it to have a name set dynamically via the branch name to avoid confusion, e.g.

  - store_artifacts:
      path: output.csv
      destination: bulk-test-result-{{ $CIRCLE_BRANCH }}.csv

However it seems like this might not be possible based on what I read at Using Environment Variables in config.yml not working - #10 by mkj

Just checking if I’m missing some simple way to do this, as it would be very useful for managing our build artifacts once we download them locally

Many thanks in advance

Sadly it is not currently possible to use environment variables in this way as they can not be used as parameter values for any of the CircleCI scripting commands.

From comments posted it seems that the CircleCI scripts are pre-compiled before a job is started and so they do not know anything about the runtime environment variables. Some way to get around this issue seems to be a common request.