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,298,527
Community Members
 
Community Events
165
Community Groups

Query for licensed users

ukhan I'm New Here Jun 13, 2022

Hi,

I am looking for a query that shows all the users who accessed one space and no other, ever since they were created or within a span of time (6 months).

1 answer

0 votes
Srinatha T Atlassian Team Jun 14, 2022

Hi @ukhan ,

Welcome to Atlassian community. 

So you want to list all users counting for the license ? if that is your requirement below is the query.

SELECT COUNT(distinct cwd_user.user_name),
cwd_group.group_name
FROM cwd_group
INNER JOIN cwd_membership ON cwd_membership.parent_id= cwd_group.id
INNER JOIN cwd_user ON cwd_user.id = cwd_membership.child_user_id
WHERE cwd_user.active = 'T'
AND cwd_user.lower_user_name IN
(SELECT u.lower_user_name
FROM cwd_user u
JOIN cwd_membership m ON u.id = child_user_id
JOIN cwd_group g ON m.parent_id = g.id
JOIN SPACEPERMISSIONS sp ON g.group_name = sp.PERMGROUPNAME
JOIN cwd_directory d ON u.directory_id = d.id
WHERE sp.PERMTYPE='USECONFLUENCE'
AND u.active = 'T'
AND d.active = 'T'
GROUP BY u.lower_user_name,
d.directory_name)
GROUP BY cwd_group.group_name
ORDER BY COUNT(cwd_user.user_name) DESC;

Thanks,

Srinath T 

ukhan I'm New Here Jun 14, 2022

That is correct, but you are missing the main requriement....which users accessed a specifc space such as "HR Department" and no other space.

Srinatha T Atlassian Team Jun 14, 2022

@ukhan  , Its tricky . I will let you know if i had any success in accomplishing the above requirement. 

Thanks,

Srinath T

Like ukhan likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

An update on Confluence Cloud customer feedback – June 2022

Hi everyone, We’re always looking at how to improve Confluence and customer feedback plays an important role in making sure we're investing in the areas that will bring the most value to the most c...

201 views 1 4
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