How to get metrics for multiple component_tree in one go?

I can get metrics for single component tree using web api “api/measures/component_tree?component=x&qualifiers=DIR&metricKeys=ncloc&strategy=all”.
How can I do the same for multiple components in one shot.
For example I want to get NCLOC metrics for all the folders under project component X and Y.

Can this be done by adding project X and Y in a portfolio and putting portfolio key as component here?

Hi,

Welcome to the community!

If you’ve already got Enterprise Edition($$) then using an Application is probably more appropriate. But yes, a Portfolio would work too.

 
HTH,
Ann