LPS-38714 Use the group of the layout. If it's a template (VirtualLayout) a conversion to the targetGroupId is made on the fly so it's fine.