Dynamically recursively get all group children from specific (non-root) group?

Is there an OOTB way to return a list of all sub-groups recursively (like the IncludeAllSubGroups parameter from core_v2_group) while setting the starting group using the ParentGroupId parameter (or another parameter) or would I need to write my own function to iterate through each sub-group replacing the ParentGroupId in the List method?

In my testing I haven't had any success with combining the two parameters and not defining a starting group yields all groups and sub-groups on the site (expectedly as it doesn't seem to be context aware of where the method was called).

End Goal: A group list widget that dynamically lists all of the children/grandchildren/etc. of the group containing the widget and is permission aware to not list groups for which the user doesn't have permissions to see.

Parents Reply Children