Hello!!
Can some one helped me in writing SQL query to fetch from DB directly for below JQL.
Project = "ABC" AND Issuetype in (Task,Story) AND createdDate >= "2019-09-01" and createdDate < "2019-10-01"
ThanksĀ in Advance!!
Regards
Ramakrishna
Here's a search some SQL you can try
For Postgres:
SELECT jiraissue.* FROM jiraissue INNER JOIN project ON jiraissue.project = project.id INNER JOIN issuetype ON jiraissue.issuetype = issuetype.idWHERE project.pkey IN ('PROJECTKEY') AND issuetype.pname IN ('Task','Story') AND jiraissue.created >= '2019-09-01' AND jiraissue.created < '2019-10-01'ORDER BY jiraissue.issuenum;
For Oracle:
SELECT jiraissue.* FROM jiraissueINNER JOIN project ON jiraissue.project = project.idINNER JOIN issuetype ON jiraissue.issuetype = issuetype.idWHEREproject.pkey IN ('PROJECTKEY')AND issuetype.pname IN ('Task','Story')AND jiraissue.created >= to_date('2019-09-01', 'YYYY-MM-DD')AND jiraissue.created < to_date('2019-10-01', 'YYYY-MM-DD')ORDER BY jiraissue.issuenum;
This should give you the issues you are looking for.
select * from jiraissue.ji where ji.issuetype in (select id from issuetype where pname in ('Task','Story'))and ji.project in(select id from project where pname in ('ABC'))-- or --(select id from project where pkey in ('ABC'))-- if ABC is the project key instead of the project nameand CREATED > '2019-08-31' -- to get 2019-09-01 included, CREATED is time/hourand CREATED < '2019-10-01'
It looks like you're new here. Sign in or register to get started.