I had posted same query some time back on the forum , however did not find appropriate response, thus trying again.
I need to find out how to get a list of subtask associated with a bug? I am not able to understand issuelinktype table for achieving this. If anyone has done this in past please share.
Thanks in advance.
Like this:
select p.pkey as parentkey, c.pkey as childkey, c.issuetype from issuelink inner join jiraissue p on issuelink.source = p.id inner join jiraissue c on issuelink.destination = c.id inner join issuelinktype t on issuelink.linktype = t.id where t.linkname = 'jira_subtask_link'
Yep, points please! Ie mark correct and vote up, thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Jamie,
I built following query based on your response, however I need resolution,issuestatus for subtask not for parent key, can you please help :
here : (abc-123 is parent key), if def-456 is subtask, it should show resolution, label for the subtask not for parent key.
select p.pkey as parentkey,p.reporter,p.assignee,p.summary,p.created,
p.resolutiondate, c.pkey as certification_ticket, c.issuetype, r.pname as resolution
,istat.pname as issuestatus
,lb.label
from issuelink
inner join jiraissue p on issuelink.source = p.id
inner join jiraissue c on issuelink.destination = c.id
inner join issuelinktype t on issuelink.linktype = t.id
inner join resolution r on p.resolution = r.id
inner join issuestatus istat on p.issuestatus = istat.sequence
inner join label lb on p.id = lb.issue
where t.linkname = 'jira_subtask_link'
and p.pkey in ('abc-3')
and c.issuetype in ('13')
order by c.pkey,lb.label;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just change your join of the resolution and label tables to join with the child instead of the parent.
select p.pkey as parentkey,p.reporter,p.assignee,p.summary,p.created, p.resolutiondate, c.pkey as certification_ticket, c.issuetype, r.pname as resolution ,istat.pname as issuestatus ,lb.label from issuelink inner join jiraissue p on issuelink.source = p.id inner join jiraissue c on issuelink.destination = c.id inner join issuelinktype t on issuelink.linktype = t.id inner join resolution r on c.resolution = r.id inner join issuestatus istat on p.issuestatus = istat.sequence inner join label lb on c.id = lb.issue where t.linkname = 'jira_subtask_link' and p.pkey in ('abc-3') and c.issuetype in ('13') order by c.pkey,lb.label;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Join on issuestatus.id
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
can someone help on this:
for 1706 issuenum, there are 3 subtask... this query returns 3 subtask but return data is commons(that's the 3 rows with 1706 data)
select * from jiraissue jr join issuetype isty on isty.id=jr.issuetype join project prj on jr.project=prj.id join issuelink islk on islk.source=jr.id where isty.pname='Request' and prj.pkey='JIRA' and jr.id = ( select jr.id from jiraissue jr, project prj where jr.project=prj.id and prj.pkey='JIRA' and jr.issuenum=1706 )
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello ,
Please let me know how to get all sub tasks and tasks for a given project , using my sql data base ..
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Punchi,
Just checking, I am also having same requirement ,did you find any solution for the SQL query to show list of sub tasks for the parent tickets
Regards
Madhu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
select p.pkey as parentkey, c.pkey as childkey, c.issuetype from issuelink inner join jiraissue p on issuelink.source = p.id inner join jiraissue c on issuelink.destination = c.id inner join issuelinktype t on issuelink.linktype = t.id where t.linkname = 'jira_subtask_link'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.