Start reading Linear teams into import jobs
Step 1 of 3 for a Linear import (fetch, preview, start). Administrators only. Names the Linear teams to read, each with the team of this workspace its issues go to, and answers 202 at once. The key, the Linear teams and the Easerix teams are all checked first, so a mistake is answered now and not found in a progress bar. Nothing is created in a team: a fetch only makes import jobs. The fetch runs in the background, one Linear team after another, and each team that is read becomes an ordinary import job in the team chosen: status `uploaded`, source `linear`, the same batch as the others, and the column mapping already saved (the suggested one, with the comment layout that keeps an author and a date). From there it is an upload: `previewImport` with the saved mapping, `commitImport`, `undoImport`, and the same reconciliation. Issues carry Linear's own identifier (ENG-123) under the source name `linear`, the name a Linear CSV export is given too, so reading a team twice, or after a CSV export of it, never imports an issue twice. The key is held in memory by the fetch and dropped when it ends. It is not stored, logged, audited or returned. A fetch cut short by a restart cannot be resumed: it is found by its heartbeat and marked failed, the admin pastes the key again, and the teams it had finished stay as jobs. Refusals: 400 `bad_key`, `bad_request` (no teams, more than 50, a team twice) or `unknown_linear_team`; 404 for a team of this workspace the caller cannot reach; 409 `fetch_in_progress` (one fetch runs per workspace) or `too_many_unfinished`; 422 `linear_key_rejected`; 429 and 502 as for `inspectLinear`. A team with more than 5,000 issues, the most one import takes, is not refused up front: it fails on its own, with the reason, and the others carry on.
View as MarkdownAuthorization
bearer In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/imports/linear/fetches" \ -H "Content-Type: application/json" \ -d '{ "apiKey": "pa$$word", "teams": [ { "linearTeamId": "string", "teamId": "a4ede8ba-7c0a-4485-8763-cbd9b282fbec" } ] }'{ "fetch": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "status": "running", "batchId": "5579c111-9c50-47e2-af92-f16d52e63189", "namespace": "string", "options": { "includeArchived": true, "includeComments": true, "linearWorkspace": "string" }, "teams": [ { "linearTeamId": "string", "key": "string", "name": "string", "teamId": "a4ede8ba-7c0a-4485-8763-cbd9b282fbec", "state": "pending", "issues": 0, "comments": 0, "importId": "84402506-7f34-4409-8ec1-a4e0ffb6b608", "code": "string", "message": "string", "notes": [ "string" ] } ], "error": "string", "cancelRequested": true, "createdAt": "2019-08-24T14:15:22Z", "finishedAt": "2019-08-24T14:15:22Z" }}List the latest Linear fetches of the workspace
Administrators only. The ten most recent, newest first, so a screen that was closed can find a fetch that is still running.
Get how a Linear fetch is going
Administrators only. Poll this while a fetch runs: each team reports its state and how many issues and comments are read, and a team that is done names the import job it became (`importId`). A fetch that is over cannot have a team still being read, so such a team is shown as `failed` with code `not_fetched`. A fetch in another workspace is a 404.