feat: import and export tickets as CSV
Every ticket of a project can be downloaded as CSV, and a CSV exported from TaskStream or from Jira can be imported: types, statuses, priorities and people are matched by id or name, the rest falls back with a warning, and parents are rebuilt. The settings page previews an import before it creates anything. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
31
libs/api/tracker/application/src/lib/transfer.service.ts
Normal file
31
libs/api/tracker/application/src/lib/transfer.service.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { CommandBus, QueryBus } from '@nestjs/cqrs';
|
||||
import {
|
||||
ExportIssuesQuery,
|
||||
ImportIssuesCommand,
|
||||
ImportReport,
|
||||
} from './transfer/import-export';
|
||||
|
||||
/** Tickets in and out as CSV (TaskStream's own, or a Jira export). */
|
||||
@Injectable()
|
||||
export class TransferService {
|
||||
constructor(
|
||||
private readonly commandBus: CommandBus,
|
||||
private readonly queryBus: QueryBus,
|
||||
) {}
|
||||
|
||||
exportCsv(viewerId: string | null, projectId: string): Promise<string> {
|
||||
return this.queryBus.execute(new ExportIssuesQuery(viewerId, projectId));
|
||||
}
|
||||
|
||||
importCsv(
|
||||
actorId: string,
|
||||
projectId: string,
|
||||
csv: string,
|
||||
dryRun: boolean,
|
||||
): Promise<ImportReport> {
|
||||
return this.commandBus.execute(
|
||||
new ImportIssuesCommand(actorId, projectId, csv, dryRun),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user