Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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 FramptonHey 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 Treuner 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
Community showcase
Published in Marketplace Apps & Integrations

☕️ Monday coffee with Jexo: Weekly Atlassian news roundup | 21st June 2021

Hi community 👋, as every Monday we're bringing you a quick update on what happened in the Atlassian ecosystem last week. There were a few interesting events like for example the announcement of th...

68 views 0 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you