how to send automatic alert mail to users who are not logged into jira from past 30days?

Yampalla Srinivas January 3, 2020

Hi,

We want to deactivate the users who are not logged into jira from past 30 days. Before deactivating them, we want send an alert mail. 

Can anyone help me how to automate this?

Thanks

2 answers

1 vote
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 3, 2020

There isn’t a way to automate this at least OOTB. What I have done is to create an excel template, export the users, drop them into my template and then filter on the ‘haven’t logged in since’. Copy the users and drop into an email.

Yampalla Srinivas January 3, 2020

@Jack Brickey 

Can't we automate by using scriptrunner also?

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 3, 2020

very possible. I haven't use the addon for some time so I can't try it out. Have you use the search bar above to see if others have solved this previously?

0 votes
Payne
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.
January 3, 2020

I don't know of a way to accomplish this within Jira, but if you have database access, you can run the following query to identify such users:

SELECT display_name,email_address,FROM_UNIXTIME(left(attribute_value,char_length(attribute_value)-3)) AS 'last_successful_login'
FROM jira.cwd_user
LEFT JOIN jira.cwd_user_attributes on jira.cwd_user.ID = jira.cwd_user_attributes.user_id AND attribute_name = 'login.lastLoginMillis'
WHERE active = 1
HAVING last_successful_login < now() - interval 30 day
ORDER BY attribute_value DESC

Suggest an answer

Log in or Sign up to answer