Function to get Direct parent group of input group

Certified Lead Developer
Is there any function which can give me a direct parent group of input group.
e.g Group A-->GroupB -->Group C

If I pass Group C to input the function it should return Group B as a result.

OriginalPostID-240483

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data