ScriptRunner Script to find users who have never logged in

sanjeev_magoo November 21, 2017

I am looking for a ScriptRunner Script to find users who have never logged into JIRA. We are over our license and looking to get rid of few users.

2 answers

1 accepted

1 vote
Answer accepted
Marianne Lee (Nagarro) November 12, 2019

Just thought of sharing an up-to-date code from Adaptavist Library (ScriptRunner), who has a script which deactivates users that have never logged in.

https://library.adaptavist.com/entity/deactivate-idle-users

1 vote
Alexey Matveev
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.
November 21, 2017

Hello, 

You can try this one

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.security.login.LoginManager

def loginManager = ComponentAccessor.getComponent(LoginManager.class);
ComponentAccessor.getUserManager().getAllUsers().each{ it->
if (loginManager.getLoginInfo(it.getKey()) ==null || loginManager.getLoginInfo(it.getKey()).getLoginCount() == 0) {
log.error(it.getKey())
}
}

Suggest an answer

Log in or Sign up to answer