Hi Guys,
I am using this to get parent details only and last field is a subtask which will tell about parent's child key and id.
I want to get details of child subtask as well like assignee, reporter, timespent etc.
Below Code:-
issues_in_project = jira.search_issues('project=11372 AND SPRINT in openSprints() and sprint not in futureSprints() and issuetype not in subTaskIssueTypes()',maxResults=1000)
for value in issues_in_project:
print value.key,
value.fields.summary,
value.fields.assignee,
value.fields.reporter,
value.fields.subtasks,
Result :-
1147, assignee_name, reporter_name, Subtask
[<JIRA Issue: key=u'DW-1150', id=u'2278424'>, <JIRA Issue: key=u'DW-1151', id=u'2278425'>, <JIRA Issue: key=u'DW-1152', id=u'2278429'>, <JIRA Issue: key=u'DWD-1153', id=u'2281635'>]
Whatever output is getting from value.fields.subtasks, based on that I want child details with some parent details Like below.
Expected result:-
Parent_key,Parent_assignee,parent_reporter,child_key,child_assignee,child_timespent,child_summary
1147,assignee_name,reporter_name,1150(child_key),child1_username,1600(child1_timespent),summary(child1_summary_details)
1147,assignee_name,reporter_name,1151(child_key),child2_username,2400(child1_timespent),summary(child1_summary_details)
Could you please suggest on this how to achieve this?
Thanks,
Hi Himanshu
Within your current loop around issues, you need to add another loop to get the ID of each sub-task, then run a query for each one. So
for value in issues_in_project
parentID = ...
for subtasks in value.fields.subtasks
subtaskID = subtasks.key
get subtask details with another query for each subtaskID
Hope this helps
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.