Forums

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

SQL to get attachment ID with project key and issue key

Bhargavi Vasa
Contributor
June 29, 2024

Iam looking for a SQL to get project key,issue key and attachment id's in jira version 8.20.5

Example :

Project Key , Issuekey , Attachment ID

TEST,TEST1,12345

TEST,TEST1,23456

TEST,TEST2,345678

 

1 answer

1 accepted

1 vote
Answer accepted
Tuncay Senturk
Community Champion
June 29, 2024

Hi @Bhargavi Vasa 

Try using the SQL query below. However, I suggest adding some 'where conditions' to filter results, as this query could return a large dataset, potentially impacting your Jira's performance (depending on how many issues your Jira instance has).

SELECT
p.pkey AS project_key,
ji.issuenum AS issue_key,
fa.id AS attachment_id
FROM
project p
JOIN
jiraissue ji ON p.id = ji.project
JOIN
fileattachment fa ON ji.id = fa.issueid;

 

Suggest an answer

Log in or Sign up to answer