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

Pull user list from a group

Hi, 

How can i get full user list from one of the groups in confluence? I am trying to use a script and do it via scriptrunner console, but i am getting an error in the script. Can you help me with the script? 

 

Script i am using:

import com.atlassian.confluence.component.ComponentAccessor

def groupManager = ComponentAccessor.getGroupManager()

String groupName = "confluence-users"

groupManager.getUsersInGroup(groupName)
There is some error with the import library but i cant tell what.

2 answers

0 votes
Peter-Dave Sheehan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 18, 2023

That's because Confluence doesn't have a class called ComponentAccessor.

You can't just translate Jira scriptrunner code for Confluence, they are very different at the java API level.

Here is how you can get all the users in a group in confluence:

import com.atlassian.sal.api.component.ComponentLocator
import com.atlassian.user.GroupManager
def groupManager =ComponentLocator.getComponent(GroupManager)
def group = groupManager.getGroup('confluence-users')
groupManager.getMemberNames(group).asList()
0 votes
Vishal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 18, 2023

Hi @Spruha Shah 

If you have access to database, you can run a simple select query & get the data. You may want to read the article.

we dont have access to the database. I am trying to do this via scriptrunner script.

Vishal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 19, 2023

Hi @Spruha Shah 

Scriptrunner should also have a database connector which should allow you run sql query, not sure if its available for server but take a look. It would be available for jira admin users next to behaviour somewhere.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events