Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,301,425
Community Members
 
Community Events
165
Community Groups

How to get Jira project statistics?

user2 I'm New Here Jun 10, 2022

To whom it may concern

I am looking how to get a Jira project size and pages. # of attachment, attachment size information. Jira is using Microsoft SQL server on-premises.

I used the script below, and I get "Invalid object name 'CONTENT'."

select count(CONTENTID) as "number of attachments", SPACES.SPACENAME from CONTENT
join SPACES on CONTENT.SPACEID = SPACES.SPACEID
where CONTENT.SPACEID is not null
and CONTENT.PREVVER is null
and CONTENT.CONTENTTYPE = 'ATTACHMENT'
group by SPACES.SPACENAME
order by "number of attachments" desc;

Thanks in advance

Barton

1 answer

3 votes

Welcome to the Atlassian Community!

Yeah, this is another reason for not looking at any Atlassian database.  Your SQL isn't for Jira, it's for Confluence.

And it's wrong, because you're not going to get the right information from it.

Forget the database, you're wasting your time.  

For Jira attachment size, look at your server - the simplest option is to look at the size of the directory <your jira data directory>/attachments

Jira "project size" is not an easy calculation - you'd need to read every part of Jira that stories bits of issues, look at the content in there, and reverse-engineer exactly how the database stores each line in the tables in the files the database is made up of.  

user2 I'm New Here Jun 14, 2022

Thanks, Nic information. Your information was useful and helpful. 

Please advise what the story behind we could not get information from database the same as confluence.

Barton

To look at a single issue, without any custom fields, you're looking at 20-30 joins.

Don't do it.

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you