Thanks Peter Skopek for this PR, what is the actual state of this issue/PR?
We have a similar problem, because we run deployments based to the user scoped credentials and this don't work since a while. So we would like to see this PR merged.
The use of the single quotes around '${credential_id}' is mandatory, it is not the same issue commented (overwrite a credentialID) but perhaps exists some relation.
Sounds like this feature may be implemented by JENKINS-58170? It works for withCredentials at least, though I've found other plugins that don't work properly with this new feature.