Is there a way to tell via the DB, what issues have been added and removed from a sprint? I'm hoping I can do it for an open sprint but a closed sprint would be better than nothing.
This information is available somewhere it seems as the sprint reports pull the necessary information.
CHANGEITEM and CHANGEGROUP tell you when the customfield value related to the sprint changes and hence what's added/removed based on the time. The SQL below is what I'm using to get the items added and removed while the sprint is in progress.
Hope that helps.
select sprint.name sprint_name,
sprint.start_date / 60 / 60 / 24 / 1000 + to_date('12/31/1969 08:00:00 PM','mm/dd/yyyy hh12:mi:ss AM') start_date,
sprint.complete_date / 60 / 60 / 24 / 1000 + to_date('12/31/1969 08:00:00 PM','mm/dd/yyyy hh12:mi:ss AM') complete_date,
'REMOVED' action, i.pkey issue_key
from changeitem ci, changegroup cg, ao_60DB71_sprint sprint, jiraissue i
where ci.field = 'Sprint' and ci.groupid = cg.id
and instr(replace(','||to_char(ci.oldvalue)||',',' ',''),',' || sprint.id || ',') > 0
and instr(replace(','||to_char(ci.newvalue)||',',' ',''),',' || sprint.id || ',') = 0
and cg.created between
sprint.start_date / 60 / 60 / 24 / 1000 + to_date('12/31/1969 08:00:00 PM','mm/dd/yyyy hh12:mi:ss AM') and
nvl(sprint.complete_date / 60 / 60 / 24 / 1000 + to_date('12/31/1969 08:00:00 PM','mm/dd/yyyy hh12:mi:ss AM'),sysdate + 21)
and sprint.start_date is not null
and cg.issueid = i.id
and not exists (select 1 from issuetype it where i.issuetype = it.id and it.pstyle = 'jira_subtask')
union all
select sprint.name,
sprint.start_date / 60 / 60 / 24 / 1000 + to_date('12/31/1969 08:00:00 PM','mm/dd/yyyy hh12:mi:ss AM') start_date,
sprint.complete_date / 60 / 60 / 24 / 1000 + to_date('12/31/1969 08:00:00 PM','mm/dd/yyyy hh12:mi:ss AM') complete_date,
'ADDED' action, i.pkey issue_key
from changeitem ci, changegroup cg, ao_60DB71_sprint sprint, jiraissue i
where ci.field = 'Sprint' and ci.groupid = cg.id
and instr(replace(','||to_char(ci.oldvalue)||',',' ',''),',' || sprint.id || ',') = 0
and instr(replace(','||to_char(ci.newvalue)||',',' ',''),',' || sprint.id || ',') > 0
and cg.created between
sprint.start_date / 60 / 60 / 24 / 1000 + to_date('12/31/1969 08:00:00 PM','mm/dd/yyyy hh12:mi:ss AM') and
nvl(sprint.complete_date / 60 / 60 / 24 / 1000 + to_date('12/31/1969 08:00:00 PM','mm/dd/yyyy hh12:mi:ss AM'),sysdate + 21)
and sprint.start_date is not null
and cg.issueid = i.id
and not exists (select 1 from issuetype it where i.issuetype = it.id and it.pstyle = 'jira_subtask')
Were you ever able to find an answer to this? I'd like to do the same thing.
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.