Sync changes from TestRail
const url = 'https://beta-api.plune.ai/v1/projects/example/integrations/testrail/sync';const options = { method: 'POST', headers: { cookie: 'plune_session=<plune_session>', 'Content-Type': 'application/json' }, body: '{"entities":["cases","suites"],"which":"all"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://beta-api.plune.ai/v1/projects/example/integrations/testrail/sync \ --header 'Content-Type: application/json' \ --cookie plune_session=<plune_session> \ --data '{ "entities": [ "cases", "suites" ], "which": "all" }'Owner only. Pulls from TestRail what changed in a project that was imported; nothing is ever written to TestRail (the client sends GET get_* and nothing else). Starts a job (an import row with sync, kind: testrail-import in GET /v1/jobs) on the import’s own chain of bounded, resumable queue steps and its rate gate, lease and ceilings; poll GET …/imports/{jobId}; Cancel and Retry are the import’s. entities must each be testrail in the modes (409 off); a TestRail project must have been imported on this connection (409). which: new adds what is missing (folders and cases) and writes over nothing; a case changed in TestRail and in Plune is listed in conflicts. which: all also updates a case TestRail changed that nobody changed in Plune since the import (its owned fields: name, precondition, steps, expected result, priority; the earlier version stays in the case history); a case changed in Plune after the import is not overwritten: it is a conflict, with the date each side changed it. A case no full pass of TestRail finds is listed in gone and not deleted; folders are never deleted. Before a case is called gone it is asked for by itself (get_case, a read); a pass that saw none of the linked cases, or that would call more than a fifth of them gone (at least 50), fails with a reason and marks nothing. With which: all an active gone case is moved to detached and any other keeps its state (it is only listed); a case that comes back is unmarked and moved back if it still carries our reason. With which: new the phase only reports: no case is moved or marked. runs brings the runs created in TestRail within the window of the last import with history (or since the first import if none had it) with their results; which: new adds results to the runs Plune has and changes nothing else, which: all also brings the name, description, environment and Plan:/Release: labels TestRail changed and finishes the runs it closed (a finished run keeps its name and environment). milestones keeps the Release: labels. A sync of runs or milestones is applied from a preview (operator decision of 25.10.2026, point 6): it needs a dry run that finished within the last 7 days with the same entities, which and TestRail project on this connection, or it answers 409 with preview: "required". The sync reads TestRail again: what changed there after the preview is in the sync too, and its own report says what it wrote. One preview stands for its request for those 7 days. A sync of cases, suites and fields needs none. Run the dry run first to see the same counters before anything is written. Every sync is an audit entry on its job: the summary (counters) and the diff (the first 40 of changes, conflicts, gone). A failure carries one of these codes: address_rejected - the address is not https, or does not resolve to a public address; unreachable - the instance did not answer in 30 seconds; credentials_rejected - TestRail answered 401 or 403: the e-mail and API key are not accepted (a revoked key included); rate_limited - TestRail asked Plune to wait: a short pause (30 seconds at most) is waited out up to three times in a call, a longer one ends the call at once; an import then goes on after the pause by itself, and fails after 20 pauses without progress; redirect_refused - the address answers with a redirect, which Plune never follows; not_json - the address answers, but not like TestRail; too_large - an answer past 20 MB; pagination_unsupported - the instance does not page its answers (limit and offset need TestRail 6.7): import a file instead; unexpected - a status the call did not expect: status carries it. The instance’s own text is never passed on. Session cookie only.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”An id from GET /v1/projects
Request Body required
Section titled “Request Body required ”object
The TestRail project to look at, one that was imported on this connection. May be left out when exactly one was.
What to look at. Each must be set to testrail in the modes (409 otherwise). cases also reads the tree; suites alone is the suite level of the tree; fields makes the references field; runs and milestones need a dry run of the same request first (409 preview).
all: update what was imported where TestRail changed it (and Plune did not). new: add what is missing and write over nothing; a case both sides changed is only listed.
Example
{ "entities": [ "cases", "suites" ], "which": "all"}Responses
Section titled “ Responses ”The job, queued
A dry run or an import. Its id is the id of its job in the queue (GET /v1/jobs); this is the part the queue has no place for.
object
paused_rate_limit: TestRail asked Plune to wait (429) for longer than a step takes — the next step goes on after the pause. credentials_rejected: the key was refused, no retry was made; replace the key and press Retry on the job.
While paused_rate_limit (#2269): when the next step goes on by itself — the same time as waitUntil of its job in GET /v1/jobs. null in every other status, and once that time has passed while the step that goes on has not settled yet.
Where the cursor { phase, id, offset } is: the lookups (priorities, shared steps), the suites, the sections, the tree in Plune, the cases, with history the runs (the lists) and the results (a page of 250 a step), and for a sync the cases no full pass found (gone).
Every counter, 0 when it did not happen. A dry run’s are what the import after it does, from the same code. cases_seen is what the instance listed; cases_created, cases_updated, cases_unchanged and cases_conflict (changed in TestRail and in Plune since the import: left as they are, listed in conflicts) sum with the cases_skipped_* (bin: the case is in the Bin and stays there; deleted: TestRail marks it deleted; bdd: Plune has no Gherkin steps; ceiling: the project has no room; invalid: Plune refused the case, or its section was not listed) to cases_seen. nodes_created / nodes_existing: the folders and suites of the tree. The rest count what the mapping leaves out or makes up: steps_shared_expanded, steps_shared_missing, cases_placeholder_expected, cases_exploratory, cases_estimate (the TestRail estimate was read into the case’s estimate: 30s 2m is 2m 30s; written for a new case and, where the case has none, for one that exists) and cases_estimate_not_transferred (text that is not an estimate: left out), cases_type_not_transferred, cases_custom_fields_not_transferred (cases with a value in a field that was not chosen or cannot be carried), priorities_unknown; an import that chose fields adds cases_custom_values (values that came across), cases_custom_values_skipped (a value the Plune field cannot hold: an option it does not have, a date in a local spelling) and custom_fields_refused (a chosen field that could not be made or mapped: it is left out, the warnings say why), and counts fields_created / fields_existing for the fields it set up; cases_refs is how many carried refs (kept in a custom field); cases_same_title is how many repeat the title of an earlier case of the same TestRail section (the same folder): they are imported all, never merged. A sync adds cases_gone (listed in gone), cases_detached (of those, moved to detached), cases_reattached (found again), fields_created and fields_existing; a sync deletes nothing. History (an import that asked for it): runs_listed = runs_beyond_plan + runs_binned (in the Bin: not brought back) + runs_already_imported (finished in Plune) + runs_to_import; runs_imported is how many of those an import has finished (0 in a dry run), runs_finished the closed ones among them. results_estimated and results_untested come from the lists of runs (a dry run reads no results); results_estimated_new is the part Plune does not hold, what the preview of a sync says it would bring: all of a run it does not have and, of a run it holds open, what the lists count beyond its newest result of each case, status by status, and at least 1 (a floor: the counts cannot see a retest with the same status) when TestRail changed the run since the last finished import or sync read it; a result of a case Plune does not have keeps its run counted until the case comes; a run inside a plan comes without updated_on in get_plan, so for one Plune holds open the job asks get_run once (one TestRail closed is dated by its completed_on), and one it cannot read counts as changed. The import reads results_seen: results_accepted (new), results_duplicate (the key and the content are there), results_conflict (the key is there with other content), results_no_case (the case is not in Plune: not imported, in the Bin), results_skipped_untested, results_skipped_invalid; results_status_unknown (a status the instance did not list: skipped, the id in the raw status), substatuses_added and substatus_overflow (past the ten a status takes: the result stays skipped without one, the word is in the raw status), dates_clamped (times cut to 2004 … now), dates_missing (a run or result came without a time: dated by the import), runs_skipped_invalid (a run listed without an id or a creation time), descriptions_truncated (a run description longer than 200 characters is kept cut to 200), results_elapsed_unparsed (not a time, or longer than 24 days), results_attachments_not_transferred. A run counts the newest result of each case; older ones stay as the case’s history. A sync that included runs says what it decided for each run it looked at: runs_new (Plune had no run of that TestRail id), runs_updated, runs_unchanged and runs_conflict (the run’s own fields compared three ways; a conflict writes nothing of the run), runs_to_finish (TestRail closed it and “all changes” finishes it), runs_finish_skipped (TestRail closed it and it stays open: “only new”, a run in conflict, or a case in it waits for a retest in Plune, which a warning names), runs_gone (a run of the base, in the window, that the lists did not give and TestRail does not have: reported in runsGone, not changed). A sync that included milestones compares the Release: label of each run the same way (without runs it touches only the labels of the runs Plune has: no run, result or finish comes) and counts a milestone once, however many runs hold its label: milestones_renamed (TestRail renamed it and “all changes” swapped the label on the runs that hold the one last written), milestones_gone (TestRail no longer lists it: the label stays; a milestone only taken off a run is a not_applied row of that run).
object
The cases left alone because both sides changed them — at most 100 of them. A sync also says when each side last changed the case (the case stays as it is in Plune).
object
A sync (or its dry run): what it was asked. null for an import.
object
A sync, or its dry run: the cases it made (created) or rewrote (updated, with the fields of the case the import owns that changed) — at most 100. caseId is absent for a case a dry run would make.
object
What history was asked for, and the dates it reaches back to; null for an import that asked for none, and for a sync without runs or milestones. A sync with them gives the window it looks at: the depth of the last import that had history (months counted back from the sync, or all), or, when none had, none with since the start of the first import. since is the oldest creation date of a run it brings (null: no limit; set once the first step of the runs is done), planDays the days of runs the plan of the account keeps (null: all).
object
The case fields of the instance (#1930): read by get_case_fields (one request) in a dry run, and in an import that was asked for fields; null otherwise, and for a sync. Not the fields the mapping reads itself, the system fields, the inactive, nor those that belong to other TestRail projects. cases is the number of cases with a value in it (an unticked checkbox, a dropdown on “None” and a zero are no value), complete when the cases are read. Every member sees the list; only the owner chooses (customFields of the import).
object
text, dropdown, checkbox, date, integer; or the TestRail type that is not carried: multi-select, user, milestone, steps, scenario.
Not supported: <type> when supported is false.
A dropdown’s options.
An import: what it was asked; pluneFieldId is the Plune field it used (null until the lookups made it).
object
A sync: the cases a full pass of the TestRail project did not find — at most 100. Nothing is deleted. detached: the case was moved to the detached state (only an active case may be; a draft stays a draft and is only listed).
object
A sync that included runs or milestones, or its dry run: the runs it made (created, no runId yet), rewrote (updated, with the run’s fields it wrote; release is the Release: label), finished (finished) and the fields of a run it did not apply (not_applied: a finished run keeps its title and environment; a field TestRail cleared is not cleared in Plune, nor the label of a deleted milestone) — at most 100. created and finished are decisions of the runs phase, the same in a dry run. [] for an import and for a sync without runs or milestones.
object
Absent for a run the sync makes.
A sync that included runs or milestones: the runs left alone because a field changed in TestRail and in Plune since the import or sync that last wrote the run — at most 100. Nothing of such a run is written, and “all changes” does not finish it. trChangedAt is TestRail’s updated_on, when it gave one.
object
A sync that included runs, or its dry run: the runs of the base, in the window, that TestRail’s lists did not give and get_run did not find — at most 100. Only a report: the run is not changed, an open one is not finished. A run is reported by the first sync that finds it gone, not again. Runs of plans are not looked for when the plans could not be listed. Lists with none of the runs of the base, or more of them missing than one sync takes as gone (20 %, at least 50), stop the sync instead. [] for an import and for a sync without runs.
object
At most 20 sentences about what the instance did not list or could not give.
When the job first reached each phase (the keys are those of phase): lookups is startedAt, done is finishedAt, a phase the job skipped is absent. A phase lasts until the next stamp. Jobs started before this field have only lookups and the stamps of the steps after it.
object
The job in the queue: its state, how many cases it has seen of how many it knows of so far (null until the cases begin), and why it stopped.
object
object
Example
{ "id": "b1f0c6e2-6c1e-4b0e-9a49-3f6f1c1a9d11", "dryRun": false, "status": "running", "ratePausedUntil": null, "trProjectId": 1, "trProjectName": "Project Alpha", "phase": "lookups", "counters": { "cases_seen": 5, "cases_created": 1, "cases_updated": 1, "cases_unchanged": 1, "cases_conflict": 1, "cases_skipped_bin": 0, "cases_skipped_deleted": 0, "cases_skipped_bdd": 0, "cases_skipped_ceiling": 0, "cases_skipped_invalid": 0, "nodes_created": 6, "nodes_existing": 6, "steps_shared_expanded": 1, "steps_shared_missing": 0, "cases_placeholder_expected": 0, "cases_exploratory": 1, "cases_estimate": 1, "cases_estimate_not_transferred": 0, "cases_refs": 1, "cases_same_title": 0, "cases_type_not_transferred": 3, "cases_custom_fields_not_transferred": 0, "priorities_unknown": 0, "cases_gone": 1, "cases_detached": 1, "cases_reattached": 0, "fields_created": 0, "fields_existing": 0, "cases_custom_values": 0, "cases_custom_values_skipped": 0, "custom_fields_refused": 0, "runs_listed": 0, "runs_beyond_plan": 0, "runs_binned": 0, "runs_already_imported": 0, "runs_to_import": 0, "runs_imported": 0, "runs_finished": 0, "results_estimated": 0, "results_untested": 0, "results_estimated_new": 0, "results_seen": 0, "results_accepted": 0, "results_duplicate": 0, "results_conflict": 0, "results_no_case": 0, "results_skipped_untested": 0, "results_skipped_invalid": 0, "results_status_unknown": 0, "substatuses_added": 0, "substatus_overflow": 0, "dates_clamped": 0, "results_elapsed_unparsed": 0, "results_attachments_not_transferred": 0, "runs_skipped_invalid": 0, "dates_missing": 0, "descriptions_truncated": 0, "runs_new": 0, "runs_updated": 0, "runs_unchanged": 0, "runs_conflict": 0, "runs_to_finish": 0, "runs_finish_skipped": 0, "runs_gone": 0, "milestones_renamed": 0, "milestones_gone": 0 }, "conflicts": [], "warnings": [], "sync": { "which": "all", "entities": [ "cases", "suites" ] }, "changes": [], "gone": [], "runChanges": [], "runConflicts": [], "runsGone": [], "history": null, "fields": null, "phaseAt": { "lookups": "2026-09-16T09:12:04.151Z", "suites": "2026-09-16T09:12:04.151Z", "sections": "2026-09-16T09:12:04.151Z", "nodes": "2026-09-16T09:12:04.151Z", "cases": "2026-09-16T09:12:04.151Z", "done": "2026-09-16T09:12:04.151Z" }, "startedAt": "2026-09-16T09:12:04.151Z", "finishedAt": null, "job": { "state": "in_progress", "progress": null, "reason": null }}Invalid body, or several TestRail projects were imported and trProjectId is missing
object
Example generated
{ "error": "example"}No / invalid session — a CLI token is refused here
You are in the project, but not as its owner
object
Example
{ "error": "project owner only"}No such project among yours, no TestRail connected, or no such TestRail project for this key
object
Example generated
{ "error": "example"}An entity asked for is off, runs or milestones were asked for without a fresh dry run of the same request (preview: "required"), no TestRail project was imported on this connection, a dry run, an import or a sync of this project is running, or the saved key cannot be read on this server
object
Examples
The mode is off
{ "error": "sync is off for: cases, suites - set the mode to \"TestRail is the source of truth\" first", "off": [ "cases", "suites" ]}Runs or milestones without a preview
{ "error": "preview this sync first: a dry run of the same entities (runs, milestones), the same changes (\"new\") and the same TestRail project, on this connection and within the last 7 days - it lists what the sync would change", "preview": "required"}The instance said no at the start: failure is the code
object
Example generated
{ "error": "example"}Rate-limited: the per-route throttle, or the per-minute request limit of the plan an API token counts by (#1442; the body names the plan, #2092). Retry-After carries the seconds until the window rolls over.
object
Example generated
{ "error": "example"}Headers
Section titled “Headers ”Seconds until the window rolls over
The server has no key to keep TestRail keys under
object
Example
{ "error": "the TestRail bridge is not configured on this server - contact your operator"}