To find or view a Jira issue from the database using SQL

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.

Please note the following information is provided as-is. Atlassian Support cannot provide further assistance with the SQL queries described below


Viewing an Issue

select * from jiraissue, project
where project.id = jiraissue.project
and project.pkey = 'KEY'
and jiraissue.issuenum = 1234;
jiraissue table schema
ColumnForeign Key
ID
projectproject.id
issuenum
summary
description
prioritypriority.id
resolutionresolution.id
issuestatusissuestatus.id
securityschemeissuesecuritylevels.id

Viewing issue versions

select jp.pkey, ji.issuenum, pv.vname
from project jp, jiraissue ji, projectversion pv, nodeassociation na
where jp.id = ji.project
and na.sink_node_entity = 'Version'
and na.source_node_id = ji.id
and pv.id = na.sink_node_id
order by jp.pkey, ji.issuenum


Viewing issue components

select jp.pkey, ji.issuenum, c.cname
from project jp, jiraissue ji, component c, nodeassociation na
where jp.id = ji.project
and na.source_node_entity = 'Issue'
and na.sink_node_entity = 'Component'
and na.source_node_id = ji.id
and c.id = na.sink_node_id


Viewing custom fields

select jp.pkey, ji.issuenum, cf.cfname, cfv.stringvalue, cfv.numbervalue
from project jp, jiraissue ji, customfield cf, customfieldvalue cfv
where jp.id = ji.project
and cfv.issue = ji.id
and cf.id = cfv.customfield
order by jp.pkey, ji.issuenum


Retrieve issue change history from database in Jira server


Retrieve a list of users assigned to project roles in Jira server




Last modified on Oct 10, 2019

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.