It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

List inactive users using a plugin

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

0 votes
Answer accepted

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().

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

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!

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.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

We want to hear from you! How do you use Slack and Atlassian together?

Hi Everyone! My name is Mina and I am on Atlassian’s Ecosystems Marketing team. Our team is focused on our technology partnerships and marketplace apps. One of Atlassian’s partners is Slack, who ...

44 views 0 4
Join discussion

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