[REVIEW ONLY DO NOT MERGE] Exportgroups

If hasGroupName is not used later the boolean check can be combined with assignment of groupName statement.