Try something like this:
select * from cwd_user where ID not in (select user_id from cwd_user_attributes where attribute_name = 'login.lastLoginMillis')
Never tried it myself but this should work because JIRA records last logged in time.
You could end up with swathes of completely broken projects if you do this. Jira can fail spectacularly if users are Report or Assignee on issues and you go and pull the users account out, and you'll get some really ugly problems with watchers, voters and other things too.
Note that it does NOT matter if they've never logged in - that does NOT stop them being used as assignee, reporter, watcher, user picker fields, groups or roles.
By all means use the SQL to find them, but do NOT delete them in the database. Use the API - via the UI or plugins, or (probably your best option) the Jira Command Line Interface (I'm pretty sure that does user deletes)
The CLI goes in via the API and respects all the permissions and caveats in there - the delete user call does the same as someone clicking "delete" - it runs off and checks that the user isn't assignee or reporter on anything before it proceeds.
Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs