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

Kimberly Deal _Columbus ACE_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 19, 2017

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 votes
Daniel Eads _unmonitored account_
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.
September 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.

Kimberly Deal _Columbus ACE_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 20, 2017

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
TAGS
AUG Leaders

Atlassian Community Events