<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D51Y00007UlhW5SAJOkta Classic EngineAdministrationAnswered2026-04-01T09:00:20.000Z2020-01-07T14:02:30.000Z2020-01-08T20:40:41.000Z

zjicp (zjicp) asked a question.

Get All Groups in Custom Group

I created a custom group called All Groups. I then want to place all groups in this custom group.

 

I then looked into creating a group rule to put all the groups in the custom group All Groups. However, I'm having a hard time getting it correct.

 

Can anyone assist?


  • t529b (t529b)

    As Vipul mentioned, you can't nest groups. However, you can create a group rule that adds members of one or more groups to another group. That could get messy if you have a lot of groups that you want to combine, but it is possible. In the following example, I have a group rule that adds all users in an Active Directory group named Ireland Office to an Okta group named Europe Users (Okta Group).

     

    Image is not available

    This example uses explicit group names, but using Okta Expression Language you could leverage regular expressions to pull in the members of all your groups.

     

    Expand Post
    Selected as Best
  • t529b (t529b)

    As Vipul mentioned, you can't nest groups. However, you can create a group rule that adds members of one or more groups to another group. That could get messy if you have a lot of groups that you want to combine, but it is possible. In the following example, I have a group rule that adds all users in an Active Directory group named Ireland Office to an Okta group named Europe Users (Okta Group).

     

    Image is not available

    This example uses explicit group names, but using Okta Expression Language you could leverage regular expressions to pull in the members of all your groups.

     

    Expand Post
    Selected as Best
  • zjicp (zjicp)

    Hi All,

     

    I was able to do it by using isMemberOfAnyGroup("") by using the Okta Expression Language. After using this, all the groups was added to my custom All Groups below:

    Image is not available

     

    I'm not sure if this was not supposed to work but it did for me. Since Vipul has mentioned that it wasn't supported, I'm highly weary of activating this rule.

     

    Any thoughts on this?

     

    Expand Post
  • bc221 (bc221)

    If you enable this new Rule it will just add all groups' members (NOT GROUPs) to your custom group "All Groups". Please correct me if you see different result. 

    Your Rule is same as shown by Mike. Once you activate that Rule and refresh the page, you will see that all groupID added by you in that Rule will get converted to groupName as shown by Mike.

    Expand Post
This question is closed.
Loading
Get All Groups in Custom Group