Map user to portal

Great :wink:
You can export the entire Organization from the Portal and import it in the Studio.

No, groovy is for server-side scripting, it cannot interact with the Studio.