Using SQL for JIRA-BIRT Reports, how to get all issues by project lead

Pranitha_Gaddam January 9, 2018

I am using the below query, but it is not working

select p.description,i.summary

from PUBLIC.PROJECTS p

inner join PUBLIC.ISSUES i on p.ID=i.PROJECTID

where p.jql='LEAD = "username"'

2 answers

1 accepted

0 votes
Answer accepted
Pablo Beltran
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.
February 6, 2018

Hi Pranitha Gaddam,

 

(1) You have to access the ISSUES table first and perform the jql on it. 

(2) Then, join the PROJECTS table to get project attributes for each issue in (1)

 

This would be the SQL+JQL query:

 

select p.description,i.summary

from ISSUES i 

join PROJECTS p on p.ID=i.PROJECTID

where i.jql='LEAD = "username"'

 

Pranitha Gaddam February 6, 2018

Thanks. That worked.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 9, 2018

Stop using SQL, it's the worst possible way to report anything in Jira.

For a start, you do not understand the structure of the data or tables, and I'm not sure about your SQL either, as the last line is nonsense.

But, if you must, then you need to explain the actual question:  It's clear you want all issues that match a question, but the kernel of your question is unclear.  "by project lead".  Where the project lead is the assignee?  Or Reporter?  Or something else?

Pablo Beltran
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.
February 6, 2018

@Nic Brough -Adaptavist-

The user means the SQL for Jira Driver app available on the Marketplace.

The Driver does not use the native database in any way:

  • No native SQL
  • No native database schema (or structure of the data or tables)

It brings a new BUSINESS database schema (tables and columns) that users understand and love.

The queries are also easier to write than Jira native database SQL as they are business-oriented.

They also support JQL to filter issues (please have a look at the WHERE clause in the example)

The Driver aborts users' reckless queries, so it is not easy to cause performance issues.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 6, 2018

That was not clear in the question.  I gave the correct answer for users thinking about direct access via SQL.

I'm aware of how that application works.

Suggest an answer

Log in or Sign up to answer