Forums

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

SQL Query to fetch all issues from specific project

RG
Contributor
March 25, 2025

Dear Experts,

I want to fetch all issues details (Issue Key, Project, Project Key, Summary, Reporter, Created Date, Resolution date, Status, XYZ) from specific project created between 1st Jan 2025 to 31st Jan 2025 along with Cascaded custom field value.

Project: ABC

Cascaded Field: XYZ (XYZ1, XYZ2)

XYZ1 : Asia, Europe

XYZ2 for Asia : India, Japan, China

XYZ2 for Europe: Germany, Sweden

Could you please help me to get correct query.

 

3 answers

1 vote
Jim Knepley - ReleaseTEAM
Atlassian Partner
March 25, 2025

Hi @RG 

If you're looking for  SQL queries, and that's not a typo in the subject, you can see the SQL schema here: https://developer.atlassian.com/server/jira/platform/database-schema/

You're probably going to use these tables:

* jiraissue

* project

* customfield

* customfieldvalue

1 vote
Aaron Pavez _ServiceRocket_
Community Champion
March 25, 2025

Hi @RG 

Getting all the issues its easy, the query is

project = namehere and createdDate >= "2025-01-01" and createdDate <= "2025-01-31"

Now about the fields you mention, you can get that information by adding the fields in to the columns. go to the icon below JQL:

2025-03-25 12_49_49-Issue navigator - Jira — Mozilla Firefox.jpg

Then you will see the fields on the screen and you can export them to CSV or any other file.

BUT you cannot get the field's context (values for each field).

Regards - Aaron

RG
Contributor
March 25, 2025

Hi @Aaron Pavez _ServiceRocket_  Thanks for your help. I am looking for DB query to fetch all records from specific project. 

JQL not allowing me to fetch more than 2000 records and we have more than 100k records for each Cascaded values. 

0 votes
Bindu Nikam-Deshpande April 1, 2025

Hi @RG

Can you please try this query and check the result

SELECT

     IssueKey, Project, ProjectKey, Summary, Reporter, CreatedDate, ResolutionDate, Status, CascadedFieldValue

FROM

IssuesTable

WHERE

Project = 'ABC'

AND CreatedDate BETWEEN '2025-01-01' AND '2025-01-31'
AND (CascadedFieldValue IN ('Asia', 'Europe', 'India', 'Japan', 'China', 'Germany', 'Sweden'));

Explanation of the query:

Cascaded Custom Field Filter: Filters the values for XYZ (both XYZ1 and XYZ2) based on your hierarchy.

Make sure to update the table name (IssuesTable) and column names (CascadedFieldValue, etc.) based on your database structure.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.20.11
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events