Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,555,496
Community Members
 
Community Events
184
Community Groups

How do you get the groupId required by the Crowd group-level-admin REST method

In my environment we create a collection of groups in Crowd to support role based access controls. We recently upgraded to Crowd Data Center and want to take advantage of the ability to distribute administration of groups.

The group-level-admin set of REST methods seems like it supports this, however, all them require groupId, which isn't the name of the group. I've tested the following rest methods, but none of them include the group ID needed by the group-level-admin methods:

  • GET /rest/admin/1.0/group/search/{directoryId}
  • GET /rest/usermanagement/1/group
  • GET /rest/usermanagement/1/search
  • POST /rest/usermanagement/1/search
  • POST /rest/usermanagement/1/group

The POST /rest/admin/1.0/groups/query method returns the group ID, but this only works if someone is already configured to be an admin of the group, which won't be the case in my environment.

Strangely enough POST /rest/admin/1.0/users/search and GET /rest/admin/1.0/directory/managed return the user ID and directory ID, but the equivalent functionality for groups doesn't.

How can I, through the Crowd REST interface get the group ID of a group if I only know the name of the group and the directory it is in?

If that functionality isn't there, are there any plugins that provide it, or plans to add it in the future? Even through the web interface I couldn't find a way to see the group ID. It seems odd that these REST methods would be added, but not a way to get the information that they require.

Thank you

2 answers

A bit of trial and error it looks like the groupId is <directory ID>-<base 64 encoded group name>.

Since the Crowd REST documentation doesn't mention this, can anybody comment if this method of creating the groupId is something that can be relied upon?

Crazy, but works for us!

that groupid format worked for me.   disappionted this is not mentioned anywhere in the REST API documentation!

@Dale FHey you write in your that yout get the user ID with the POST /rest/admin/1.0/users/search can you show me how, please? i'm searchin since a lot of tim for a solution to get the crowd userId but i just find the a solution to get the user key

Here's a snippet of Python code that will generate the groupid

import base64
def get_id(directory_id, group_name):
    return ('{}-{}'.format(
                directory_id,
                base64.b64encode(group_name.encode('utf8')).decode(),
               ))

Like Heiko likes this

Hey Dale thanks for your reply. But that's not what I'm searching for. I wrote an post 2 weeks ago. https://community.atlassian.com/t5/Crowd-questions/How-to-get-the-userId-of-an-specific-user-for-the-audit-Log/qaq-p/1299406#M5303 maybe you know what i searching for and have a solution for me.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events