SQL to return for every project most recent updated date

We are hosting > 100 projects in our JIRA instance. I'd like to know if all of these projects are active.

Current idea is to run a query that returns the most recent update date or create date for any issue, one for each project.  So it doesn't matter which issue within the project it is.  I just want to know when the last activity was.

Hope this makes sense. If you have a better way to gather this information would love to hear it.

If it makes a difference, we're running postgresql.

Thanks.

2 answers

1 accepted

This widget could not be displayed.

Hello team,

Please try the query from this previous answer:

https://answers.atlassian.com/questions/176459

I've adapted it to postgres:

SELECT DISTINCT i.PROJECT, MIN(i.UPDATED) as "Last Updated", p.pname
FROM jiraissue i
INNER JOIN project p
ON p.ID = i.PROJECT
GROUP BY i.PROJECT, p.pname
ORDER BY MIN(i.UPDATED) ASC, i.PROJECT, p.pname

That is Brilliant!!! Thank you so much.

I spoke too soon. :( the results indicated for project ABC that the last update was on 2012-10-16. But when I search on issues for that project, I see updates as recent as 8 days ago. I'll play around with it. I see where you are going here.

Okay, changed MIN to MAX and it's a thing of beauty! SELECT DISTINCT i.PROJECT, MAX(i.UPDATED) as "Last Updated", p.pname FROM jiraissue i INNER JOIN project p ON p.ID = i.PROJECT GROUP BY i.PROJECT, p.pname ORDER BY MAX(i.UPDATED) ASC, i.PROJECT, p.pname;

Question ... know what the query would be for confluence and stash??????

Hi,

do you know how i can get it to list the project keys instead of the project names? or to list both the project keys and names?

This widget could not be displayed.

DI2E SysAdmin was right max and min needs to be switched for this query to work correctly. Thanks all!

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

97 views 1 0
Join discussion

Atlassian User Groups

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!

Find my local user group

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

Groups near you