Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

List inactive users using a plugin

Angel Montenegro October 1, 2012

Hi,

I'm writing a plugin to get some information from confluence. That information includes a list of all inactive (deleted) users that has written a comment on a specific space.

How to do that using the Confluence Plugin API?

I tried using the following managers, but all of them work only with active users:

  • SpaceManager
  • UserManager
  • SpacePermissionManager
  • PermissionManager

I really need some help here.

Thanks a lot.

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Michael Danielsson
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.
October 2, 2012

You can use

userAccessor.isDeactivated(user)

to examine if the user is deactivated.

If your plugin extends the class ConfluenceActionSupport you can get the userAccessor by the help of the method getUserAccessor().

0 votes
JohnA
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.
October 1, 2012

Hi Angel,

I think the following documents might be of some use to help you develop a plugin to identify inactive users:

https://confluence.atlassian.com/display/CONFKB/How+to+Identify+Inactive+Users+in+Confluence
https://developer.atlassian.com/display/CONFDEV/Confluence+Plugin+Guide

All the best,
John

MatthewC
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.
October 1, 2012

It will work when the website is back up again. Atlassian seem to be having some issues with servers today, this is the 2nd service that's been down today. maybe it's upgrade day!

Angel Montenegro October 1, 2012

Hi John,

The first link doesnt work https://confluence.atlassian.com/display/CONFKB/How+to+Identify+Inactive+Users+in+Confluence

Is that the right link?

Thanks

Angel Montenegro October 2, 2012

Hey Matthew, do you know how to execute queries inside the plugin?

In order to get the list of inactive users I need to perform the following quer:

select * from cwd_user
where active = 'F';
But I dont know how to do that using the search classes provided on Confluence, I tried with the following classes, but I couldnt construct a query to get the inactive users:
import com.atlassian.confluence.search.v2.ISearch;
import com.atlassian.confluence.search.v2.QueryFactory;
import com.atlassian.confluence.search.v2.SearchManager;
import com.atlassian.confluence.search.v2.SearchQuery;
import com.atlassian.confluence.search.v2.query.AllQuery;
Any help will be greatly appreciated.
TAGS
AUG Leaders

Atlassian Community Events