Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 21:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×SQL Query to get issue id of all the issues with issue type as Defect, status as closed of a particular project and for a particular version in Jira 6.1
hello Rohan,
you said that pkey is completely removed but it is present along with issuenum. check once again.
Also it is safe to use JQL rather using SQL as Nic Suggested.
Hi Bharadwaj,
pkey exists, but it has null values for all the entries in the table.
Also the code has already been written and since we are planning to migrate to Jira 6.1 we are facing this problem. This is a small application which has been added to a plugin(created by my team) to fetch issue details and populate the values in an excel sheet. I just need an sql query with some modification that will give the issueid(ex:- JST-1041) of the issues with a particular fixed version value of a project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'd do that in JQL in Jira, not SQL. It's easier to construct, faster, respects security, and you can save it as a filter which is dynamic, exportable, shareable and can be used as the basis for reports.
In JQL,
issuetype = Defect and status = closed and project = <xyz> and version = <123>
In SQL, you'll need to join issue to issuetype, nodeassociation, project and status to begin with...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nic,
I have a query that'd do that in Jira 5.0.7 and the query goes -> "SELECT vname FROM projectversion, nodeassociation, jiraissue WHERE ASSOCIATION_TYPE = 'IssueFixVersion' AND SINK_NODE_ID = projectversion.id AND SOURCE_NODE_ID = jiraissue.id AND pkey like '"+pkey+"'"
Since, in Jira 6.1, pkey column in table jiraissue has been removed and a new column has been added "issuenum", I am facing this problem in my java code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Two things spring to mind:
1. You should NOT be embedding SQL in Java code. Why are you not simply using a proper internal JQL call which will be faster, safer and would have continued to work fine after your upgrade?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.