Hello,
I need SQL query to find the list of the projects which have inactive project leads in it.
Thanks
SELECT * FROM project WHERE lead NOT IN (SELECT user_name FROM cwd_user WHERE active = 1);
Pleaase refer
below link
https://confluence.atlassian.com/jirakb/searching-for-projects-by-name-does-not-work-if-project-lead-is-not-defined-in-jira-777008133.html
Hello Sree,
Thanks for your reply but above query will be the list of those project where project lead is not assigned.
Here I am looking for list of those project were project lead is inactive.
You could modify that query to eliminate the projects without a lead and only show you ones where the lead user account is inactive in Jira with something like:
SELECT * FROM project WHERE lead IN (SELECT user_name FROM cwd_user WHERE active = 0);
But I can also see a problem with this query. It's returning the user_name field form the cwd_user table. That will probably work for most cases, but it's possible that user accounts in jira could have been renamed at some point. If that happens, the lead field in the project table won't match the user_name field in the cwd_user table. Which is why we should look at the app_user table's user_key field to see which account corresponds correctly to that project lead field.
So I think a more accurate SQL query for what you want would be:
SELECT * FROM project WHERE lead IN (select user_key from app_user aujoin cwd_user cu on cu.lower_user_name=au.lower_user_namewhere cu.active=0;)
@Andy Heinzer Is there any way to do this with either Groovy or Automation for Jira.....or just plain REST API?We are spending quite some support time on reviewing for inactive Project Leads on a monthly basis, hence we do not allow Projects without an ownership and have numerous other side effects to it(Dead projects/issues, Cannot delete the user, Archived Projects etc.)Would really like an Autoamtion rulr or script that just:
An alternative method, is to loop over all inactive users and check if they are Project Leads on any projects.
It looks like you're new here. Sign in or register to get started.