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

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

Crowd script that can find users who have been inactive for more than X days and deactivate them

Edited

Hi, 

As my title states I need help developing a script that can find crowd users who have been inactive for over X days and deactivate them. 

I was hoping someone could share a script I could use as my starting off point and tweak it if necessary. 

I've researched this topic a bit and think Crowd Rest APIs would be what I need to use, but I am open to any suggestions. 

 

A few things to note, we do not have scriptrunner in our environment, so my plan was a to develop a script I could set as a cronjob to be run once a month. 

1 answer

0 votes

Hey @P 

If you have direct DB access, this is a much more straightforward process - if so, MySQL/PSQL/MSSQL?

However to start, how do you define "active"? 

We've struggled with this - if you're using Jira/Confluence etc as apps connected to Crowd, if you have say 10 users in Crowd (User1 , User2 ... User 10) and they're all synced to Jira and Confluence - User1 may be the only user logging in to Jira/Confluence and assigning/at mentioning  user2,3,4,5,6 etc - those users get email notifications, reply via email, their replies are then ingested in to the tickets/pages in jira/conf - thought they have never logged in to the webui, so Crowd does not timestamp their lastAuthenticated attribute. If you disable User2-10 in Crowd, User1 can no longer do their job as expected.

 

CCM

Thanks for the reply!

 

I do have direct access the the Postgres DB. 

Also to answer your question about defining activity. 

I'm fine with lastAuthenticated attribute being the metric, we use to define it. 

Because if they really need access they will reach back out and I can restore their access. 

We have the 2000 user license. So it wont be that troublesome. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
Community showcase
Published in Jira

Admins, notify your Jira instance of system-wide changes with the new admin announcement banner

Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across their  Jira Cloud instance.  ...

503 views 16 17
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