Add id's to reports. Fixes #1142

remotes/origin/4.0rc
Álex Hermida 2018-09-11 10:01:07 +02:00 committed by Alex Hermida
parent ec245fe029
commit eec207cdac
4 changed files with 34 additions and 21 deletions

View File

@ -164,10 +164,11 @@ def update_epic_related_userstories_order_in_bulk(bulk_data: list, epic: object)
def epics_to_csv(project, queryset):
csv_data = io.StringIO()
fieldnames = ["ref", "subject", "description", "owner", "owner_full_name", "assigned_to",
"assigned_to_full_name", "status", "epics_order", "client_requirement",
"team_requirement", "attachments", "tags", "watchers", "voters",
"created_date", "modified_date", "related_user_stories"]
fieldnames = ["id", "ref", "subject", "description", "owner", "owner_full_name",
"assigned_to", "assigned_to_full_name", "status", "epics_order",
"client_requirement", "team_requirement", "attachments", "tags",
"watchers", "voters", "created_date", "modified_date",
"related_user_stories"]
custom_attrs = project.epiccustomattributes.all()
for custom_attr in custom_attrs:
@ -188,6 +189,7 @@ def epics_to_csv(project, queryset):
writer.writeheader()
for epic in queryset:
epic_data = {
"id": epic.id,
"ref": epic.ref,
"subject": epic.subject,
"description": epic.description,

View File

@ -78,12 +78,13 @@ def create_issues_in_bulk(bulk_data, callback=None, precall=None, **additional_f
def issues_to_csv(project, queryset):
csv_data = io.StringIO()
fieldnames = ["ref", "subject", "description", "sprint", "sprint_estimated_start",
"sprint_estimated_finish", "owner", "owner_full_name", "assigned_to",
"assigned_to_full_name", "status", "severity", "priority", "type",
"is_closed", "attachments", "external_reference", "tags", "watchers",
"voters", "created_date", "modified_date", "finished_date", "due_date",
"due_date_reason"]
fieldnames = ["id", "ref", "subject", "description", "sprint_id", "sprint",
"sprint_estimated_start", "sprint_estimated_finish", "owner",
"owner_full_name", "assigned_to", "assigned_to_full_name",
"status", "severity", "priority", "type", "is_closed",
"attachments", "external_reference", "tags", "watchers",
"voters", "created_date", "modified_date", "finished_date",
"due_date", "due_date_reason"]
custom_attrs = project.issuecustomattributes.all()
for custom_attr in custom_attrs:
@ -103,9 +104,11 @@ def issues_to_csv(project, queryset):
writer.writeheader()
for issue in queryset:
issue_data = {
"id": issue.id,
"ref": issue.ref,
"subject": issue.subject,
"description": issue.description,
"sprint_id": issue.milestone.id if issue.milestone else None,
"sprint": issue.milestone.name if issue.milestone else None,
"sprint_estimated_start": issue.milestone.estimated_start if issue.milestone else None,
"sprint_estimated_finish": issue.milestone.estimated_finish if issue.milestone else None,

View File

@ -118,11 +118,16 @@ def snapshot_tasks_in_bulk(bulk_data, user):
def tasks_to_csv(project, queryset):
csv_data = io.StringIO()
fieldnames = ["ref", "subject", "description", "user_story", "sprint", "sprint_estimated_start",
"sprint_estimated_finish", "owner", "owner_full_name", "assigned_to",
"assigned_to_full_name", "status", "is_iocaine", "is_closed", "us_order",
"taskboard_order", "attachments", "external_reference", "tags", "watchers",
"voters", "created_date", "modified_date", "finished_date", "due_date",
fieldnames = ["id", "ref", "subject", "description", "user_story", "sprint_id",
"sprint", "sprint_estimated_start", "sprint_estimated_finish",
"owner", "owner_full_name",
"assigned_to",
"assigned_to_full_name", "status", "is_iocaine", "is_closed",
"us_order",
"taskboard_order", "attachments", "external_reference",
"tags", "watchers",
"voters", "created_date", "modified_date", "finished_date",
"due_date",
"due_date_reason"]
custom_attrs = project.taskcustomattributes.all()
@ -144,10 +149,12 @@ def tasks_to_csv(project, queryset):
writer.writeheader()
for task in queryset:
task_data = {
"id": task.id,
"ref": task.ref,
"subject": task.subject,
"description": task.description,
"user_story": task.user_story.ref if task.user_story else None,
"sprint_id": task.milestone.id if task.milestone else None,
"sprint": task.milestone.name if task.milestone else None,
"sprint_estimated_start": task.milestone.estimated_start if task.milestone else None,
"sprint_estimated_finish": task.milestone.estimated_finish if task.milestone else None,

View File

@ -194,12 +194,11 @@ def open_userstory(us):
def userstories_to_csv(project, queryset):
csv_data = io.StringIO()
fieldnames = ["ref", "subject", "description", "sprint",
"sprint_estimated_start",
"sprint_estimated_finish", "owner", "owner_full_name",
"assigned_to",
"assigned_to_full_name", "assigned_users",
"assigned_users_full_name", "status", "is_closed"]
fieldnames = ["id", "ref", "subject", "description", "sprint_id", "sprint",
"sprint_estimated_start", "sprint_estimated_finish", "owner",
"owner_full_name", "assigned_to", "assigned_to_full_name",
"assigned_users", "assigned_users_full_name", "status",
"is_closed"]
roles = project.roles.filter(computable=True).order_by('slug')
for role in roles:
@ -237,9 +236,11 @@ def userstories_to_csv(project, queryset):
writer.writeheader()
for us in queryset:
row = {
"id": us.id,
"ref": us.ref,
"subject": us.subject,
"description": us.description,
"sprint_id": us.milestone.id if us.milestone else None,
"sprint": us.milestone.name if us.milestone else None,
"sprint_estimated_start": us.milestone.estimated_start if
us.milestone else None,