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

Email notification when a certain user logs in?

Yen-Wu Lo June 16, 2020

I'm trying to implement JSD Server in my organization. I want to add an admin user, and use it only when changes must be made. For security purposes, I wonder if I can set up the system so it sends me an email notification when the admin user logs in. Is this possible, or is there a better way to do it?

1 answer

1 accepted

0 votes
Answer accepted
Mathis Hellensberg
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.
June 16, 2020

You can probably do this with Scriptrunner. I'm thinking setting it up as a job that runs every X minutes.

This code should show you the usernames and last login time of all users with a current Jira session.

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.web.session.currentusers.JiraUserSessionTracker
import org.apache.log4j.Logger;
import org.apache.log4j.Level;

log.setLevel(Level.DEBUG);

def sessionTracker = JiraUserSessionTracker.getInstance();
def sessionSnapshot = sessionTracker.getSnapshot()

sessionSnapshot.each() { userSession ->
log.info("Username: ${userSession.getUserName()} - Last Access Time: ${userSession.getLastAccessTime()}")
}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events