How can I get a return for users not assigned to a group. ie confluence-users

I saw this question for Jira, from some years ago, so I don't know if it would be terribly accurate answers, but even changing over the jira specifics to confluence it didn't seem to work

We have recently changed which department was responsible for adding jira users, and there was a change in the AD groups, which meant that people were not being assigned to our inhouse equivalent to confluence-users, nor were they being added manually to confluence-users.  We now need to find everyone that is not assigned to confluence-users and assign them to the group.  

I see in the Scriptrunner documentation that this is possible, but I haven't been able to find concrete examples of this being done in Confluence.  Help/Direction would be appreciate.

1 answer

0 vote
Daniel Eads Community Champion Sep 19, 2017

Well, here’s SQL below for identifying those folks if you at least want a count...

SQL BELOW HERE
(select user_name from CWD_USER

left join CWD_USER_ATTRIBUTE on CWD_USER.id = CWD_USER_ATTRIBUTE.USER_ID

where CWD_USER.DIRECTORY_ID = ‘AD_DIR_ID’ and ATTRIBUTE_NAME = ‘autoGroupsAdded’)

MINUS

(select user_name from CWD_USER

left JOIN CWD_MEMBERSHIP on CWD_USER.ID = CHILD_USER_ID

left join CWD_USER_ATTRIBUTE on CWD_USER.id = CWD_USER_ATTRIBUTE.USER_ID

where CWD_USER.DIRECTORY_ID = ‘AD_DIR_ID’ and ATTRIBUTE_NAME = ‘autoGroupsAdded’ and PARENT_ID = ‘AD_DIR_ID’)

SQL ABOVE HERE
(crafted on Oracle)


Swap out three occurrences of “AD_DIR_ID” with the actual ID of your AD directory. You could also use SQL to add those groups reasonably, but knowing how much your DBA loves you Kimberly, using ScriptRunner as you’re hoping to do is probably a better idea.

Yeah, I don't get much love from the DBAs, especially when it involves breaking glass, so ScriptRunner is really the way I'd like to take on this challenge.  But really, I'm sure half of it is that they have better things to do with their day than run queries for me.




Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

197 views 0 6
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you