Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Its possible to read data directly from a jira server database?

Enrique Valverde Soriano
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 5, 2023

We are using API calls in our application but in some cases reading data from issues takes a lot of time, is it possible to access the database (according to the configuration of jira it runs on mysql57) to retrieve the data directly from it? if possible what should we need to have this running?

2 answers

2 accepted

1 vote
Answer accepted
Florian Bonniec
Community Champion
January 5, 2023

Hi @Enrique Valverde Soriano 

 

I usually avoid to query the db directly but you can do it by connecting to the db. You need your db admin to create an account with read only access to the jira db they have configured for the app.

 

Then base on the JIRA db schema and the jira version you can query the db using script or mysql workbench for instance.

 

https://developer.atlassian.com/server/jira/platform/database-schema/

 

Regards

0 votes
Answer accepted
Nic Brough -Adaptavist-
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.
January 5, 2023

Welcome to the Atlassian Community!

I very strongly recommend that you do not do this.  The Jira database is not intended for any form of reporting, it's a data store for the application.

If you go down the route of reading the database, you will be making a world of pain for yourself.  At best, you're going to be spending months working out what SQL might get you the same data a simple REST call can fetch in one go.  At worst, you're going to be building SQL that is howlingly non-performant and makes Jira unusable for everyone.

As an example "show me an issue that has one custom field set" means at least 18 joins, some 2-5 layers deep.

Please, stick with the REST calls.  They're easier, cheaper, and the right way to do it.

Enrique Valverde Soriano
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 9, 2023

Many thanks for your response!

In order to stick only to REST calls, is there any way of improving the response times? i have tried with JQL filtering the fields and number of results but in some situations the time taken by these querys is not good enough.

Any tips, documentation or guidelines to follow in order to improve these response times? i'm talking about querys that retrieve all the information about the issues generated by several projects so the amount of data is quite big.

Nic Brough -Adaptavist-
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.
January 9, 2023

The only way to shorten them is to simplify the queries, avoiding the use of functions.

If that makes you look again at SQL, I should point out that most of your queries are going to be slower than REST, and can make your Jira unusable for others.

Suggest an answer

Log in or Sign up to answer