Substituting a dependency with one that has a different configuration

I would like to substitute a sub project dependency with one that has a different configuration. For example I have:

 compile( project(path:":foo") )

But I want to substitute it with:

 compile( project(path:":foo", configuration:'myconfiguration') )

Using ResolutionStrategy you seem to be able to substitute the coordinates but not the configuration. Am I missing something?