EaserixDocs
DevelopersAPI referenceTasksImports

Say which teams a file names

Before an upload, for a file that holds several teams (a Linear export of a whole workspace). Administrators only (`org.settings.manage`). multipart/form-data with the CSV in `file` and, optionally, `column`, the header of the column that names the team. Without `column` it is the `Team` column, and `teamColumn` is null when the file has none (a Jira file has none, but its Project column can be named). Nothing is stored. Each name in the file comes back with how many rows it has and `match`, the team of the workspace it most likely means: by team name, then by team key, ignoring case and spacing. `match` is null when nothing fits or when two teams fit, because Accounts allows two teams to share a name and a guess would put issues in a team nobody chose. Only teams the caller can reach are matched. Rows with no team are counted in `noTeamRows`.

View as Markdown
POST
/v1/imports/inspect
AuthorizationBearer <token>

In: header

Request Body

multipart/form-data

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/imports/inspect" \  -F file="string"
{  "file": {    "headers": [      "string"    ],    "rowCount": 0,    "delimiter": "string",    "encoding": "utf-8",    "warnings": [      "string"    ]  },  "detected": {    "source": "linear",    "namespace": "string",    "notes": [      "string"    ]  },  "teamColumn": "string",  "teams": [    {      "name": "string",      "rows": 0,      "match": {        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "name": "string",        "key": "string"      }    }  ],  "noTeamRows": 0}

Upload a file to import

Step 1 of 3 (upload, preview, commit). Administrators only (`org.settings.manage`). multipart/form-data with the CSV in `file` (at most 10 MB and 5,000 rows) and the target `teamId`. The file is read at once, so one that cannot be used (empty, not a CSV, a stray quote, too many rows) is refused with 422 and nothing is stored. UTF-8, UTF-16 and Windows-1252 are recognised, and the separator is detected. Nothing is written to the team. The response carries the file's headers, a few sample rows, and `suggestedMapping`, a starting point guessed from the header names for the caller to review. `namespace` names where the file's row ids come from: rows already imported under the same namespace are recognised on a re-run and skipped. It defaults to one derived from the file name, or to `linear` or `jira` for an export of that tool, so overlapping exports share it. `detected` is set when the file is recognised as another tool's export. `previousImport` is set when this exact file was imported into the team before. Uploads that are never committed are closed after 24 hours and their file deleted. A team holds at most 10 unfinished imports (409).

Upload a file that names several teams, one import per team

Step 1 of 3 for a file that holds several teams. Administrators only (`org.settings.manage`). multipart/form-data with the CSV in `file`, the `teamMap`, and optionally `column`, `source` and `namespace` as on `createImport`. The file is cut by team and each team's rows become an ordinary import in that team, so what an import promises (one team, a preview before it runs, a ledger that makes a re-run harmless, an undo) is unchanged. The imports of one upload share a `batchId`, and each is then previewed and committed with the routes of a single import. A part is a file of its own, so its rows are numbered within it, and a part that is the same as one imported before is recognised by `previousImport`. `teamMap` is a JSON object with one entry for every team the file names: the name as written in the file (case and spacing do not matter), and the id of the team its rows go to, or null to leave them out. A name the map does not mention is refused (`team_not_mapped`), because dropping rows by leaving them out of the map is how work is lost unnoticed. Several names may go to one team, and their rows are then one import, in file order. Teams are never created: a team the file names that the workspace does not have is left out until it exists in Accounts. A team the caller cannot reach is a 404. Everything is stored or nothing is. At most 50 teams, and a team holds at most 10 unfinished imports (409 with the `teamId`). A file that cannot be cut without changing it is refused with `not_splittable`.