SQL to retrieve issue details

Can you please provide the SQL to collect all information about issue, including comments, statuses, etc. we know the issue ID, looking for SQL which will take input as issueID, will return all information.

2 answers

This widget could not be displayed.

It's long, complex and clumsy.  It can change with different versions, and I wouldn't even try to build a single querty that would get "everything" because it'll be in a dreadful format for you.

I would suggest taking a good hard look at why you are asking for this?  I can pretty much guarantee that "read the raw database" is the worst possible way to do what you are trying to do.

If you insist though, then please see https://developer.atlassian.com/display/JIRADEV/Database+Schema

we want to import one particular issue from our backup database to production DB, not sure how much extra tables need to join to get all details.

You will need to join around 18 tables together, and the process is complex if you use SQL: Stop JIRA Take a full backup Ensure that you can build a working JIRA from that backup Run the SQL Restart JIRA Re-index it Test thoroughly Let users back in A far better option would be to export the xml from the backup, use "project import" in a temporary JIRA to import the missing issue.

This widget could not be displayed.

It is possible to use SQL for JIRA to perform the query you are asking for. 

Ex:

 

select *
from issues i inner join comments c on c.issueid = i.id inner join issuestatusdefinitions sd on i.statusid=sd.id where i.id=?

All the Issue fields (including custom fields) are covered by SQL for JIRA so you can join the rest of the issu tables in order to view all the data at a glance.

 

 

 

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 Aug 06, 2018 in Jira Service Desk

A is for Activate: Share your top Jira Service Desk onboarding tips for new users!

Hi, everyone! Molly here from the Jira Service Desk Product Marketing Team :).  In the spirit of this month's  august-challenge, we're sourcing stories of Jira Service Desk activation fro...

593 views 25 15
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