Ah ok. Unfortunately the assets replacement is static and processed before the script is executed. So there is no way to make it dynamic as you require.
I've created github task to give it some thoughts.

The solutions which you can evaluate now:

Load all assets you need into script and choose based on your input dynamically afterwards Use REST based http request from the script to fetch the asset you need. Something like require('request').get(`http://localhost:5488/odata/assets?$filter=name eq '${req.data.par}'`)... Write few lines of [custom extension(https://jsreport.net/learn/custom-extension)