diff --git a/CHANGELOG.md b/CHANGELOG.md index d3c37b81..defcb4db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ - Add catalan (ca) translation. - Add traditional chinese (zh-Hant) translation. - Add Jitsi to our supported videoconference apps list - +- Add tags field to CSV reports. ### Misc - New contrib plugin for letschat (by Δndrea Stagi) diff --git a/taiga/projects/issues/services.py b/taiga/projects/issues/services.py index 0733bc87..d659b527 100644 --- a/taiga/projects/issues/services.py +++ b/taiga/projects/issues/services.py @@ -68,7 +68,7 @@ def issues_to_csv(project, queryset): fieldnames = ["ref", "subject", "description", "milestone", "owner", "owner_full_name", "assigned_to", "assigned_to_full_name", "status", "severity", "priority", "type", "is_closed", - "attachments", "external_reference"] + "attachments", "external_reference", "tags"] for custom_attr in project.issuecustomattributes.all(): fieldnames.append(custom_attr.name) @@ -91,6 +91,7 @@ def issues_to_csv(project, queryset): "is_closed": issue.is_closed, "attachments": issue.attachments.count(), "external_reference": issue.external_reference, + "tags": ",".join(issue.tags or []), } for custom_attr in project.issuecustomattributes.all(): diff --git a/taiga/projects/tasks/services.py b/taiga/projects/tasks/services.py index d4a00a1e..89fec76c 100644 --- a/taiga/projects/tasks/services.py +++ b/taiga/projects/tasks/services.py @@ -85,7 +85,7 @@ def tasks_to_csv(project, queryset): fieldnames = ["ref", "subject", "description", "user_story", "milestone", "owner", "owner_full_name", "assigned_to", "assigned_to_full_name", "status", "is_iocaine", "is_closed", "us_order", - "taskboard_order", "attachments", "external_reference"] + "taskboard_order", "attachments", "external_reference", "tags"] for custom_attr in project.taskcustomattributes.all(): fieldnames.append(custom_attr.name) @@ -109,6 +109,7 @@ def tasks_to_csv(project, queryset): "taskboard_order": task.taskboard_order, "attachments": task.attachments.count(), "external_reference": task.external_reference, + "tags": ",".join(task.tags or []), } for custom_attr in project.taskcustomattributes.all(): value = task.custom_attributes_values.attributes_values.get(str(custom_attr.id), None) diff --git a/taiga/projects/userstories/services.py b/taiga/projects/userstories/services.py index fefc15c3..13624162 100644 --- a/taiga/projects/userstories/services.py +++ b/taiga/projects/userstories/services.py @@ -121,7 +121,8 @@ def userstories_to_csv(project,queryset): fieldnames += ["backlog_order", "sprint_order", "kanban_order", "created_date", "modified_date", "finish_date", "client_requirement", "team_requirement", "attachments", - "generated_from_issue", "external_reference", "tasks"] + "generated_from_issue", "external_reference", "tasks", + "tags"] for custom_attr in project.userstorycustomattributes.all(): fieldnames.append(custom_attr.name) @@ -152,6 +153,7 @@ def userstories_to_csv(project,queryset): "generated_from_issue": us.generated_from_issue.ref if us.generated_from_issue else None, "external_reference": us.external_reference, "tasks": ",".join([str(task.ref) for task in us.tasks.all()]), + "tags": ",".join(us.tags or []), } for role in us.project.roles.filter(computable=True).order_by('name'): diff --git a/tests/integration/test_issues.py b/tests/integration/test_issues.py index 9cd3d2af..43ac01e0 100644 --- a/tests/integration/test_issues.py +++ b/tests/integration/test_issues.py @@ -195,6 +195,6 @@ def test_custom_fields_csv_generation(): data.seek(0) reader = csv.reader(data) row = next(reader) - assert row[15] == attr.name + assert row[16] == attr.name row = next(reader) - assert row[15] == "val1" + assert row[16] == "val1" diff --git a/tests/integration/test_tasks.py b/tests/integration/test_tasks.py index 63fe177e..6f8d3206 100644 --- a/tests/integration/test_tasks.py +++ b/tests/integration/test_tasks.py @@ -145,6 +145,6 @@ def test_custom_fields_csv_generation(): data.seek(0) reader = csv.reader(data) row = next(reader) - assert row[16] == attr.name + assert row[17] == attr.name row = next(reader) - assert row[16] == "val1" + assert row[17] == "val1" diff --git a/tests/integration/test_userstories.py b/tests/integration/test_userstories.py index ceb0cc12..8f26e8c7 100644 --- a/tests/integration/test_userstories.py +++ b/tests/integration/test_userstories.py @@ -276,6 +276,6 @@ def test_custom_fields_csv_generation(): data.seek(0) reader = csv.reader(data) row = next(reader) - assert row[23] == attr.name + assert row[24] == attr.name row = next(reader) - assert row[23] == "val1" + assert row[24] == "val1"