Set the sync mode of the entities
const url = 'https://beta-api.plune.ai/v1/projects/example/integrations/testrail/sync/modes';const options = { method: 'PUT', headers: { cookie: 'plune_session=<plune_session>', 'Content-Type': 'application/json' }, body: '{"cases":"testrail","suites":"testrail","runs":"off","milestones":"off","fields":"off"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://beta-api.plune.ai/v1/projects/example/integrations/testrail/sync/modes \ --header 'Content-Type: application/json' \ --cookie plune_session=<plune_session> \ --data '{ "cases": "testrail", "suites": "testrail", "runs": "off", "milestones": "off", "fields": "off" }'Owner only. off (the default) or testrail (“TestRail is the source of truth”: a sync brings its changes in) for each entity named; the others stay. There is no mode in which Plune writes to TestRail: that needs a decision and an ADR of its own. Recorded in the audit feed as a testrail_connection entry (update) with the modes before and after. 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 ”The entities named change, the others stay.
object
Example
{ "cases": "testrail", "suites": "testrail", "runs": "off", "milestones": "off", "fields": "off"}Responses
Section titled “ Responses ”The modes now
object
The mode of each entity, off by default. runs and milestones (#1963) look at the window of the history import, and a sync of either is applied from its dry run.
object
Folders and cases: names, preconditions, steps, expected results, priority, location.
The suites of an imported project (the folders made for them).
Runs and their results, within the window of the history import: the runs created since, renames, descriptions, environments, Plan: labels and the runs TestRail closed.
The Release: label of a run follows its milestone; a milestone deleted in TestRail leaves the label in place.
The custom case fields the import created (the field of TestRail’s references).
Example
{ "modes": { "cases": "testrail", "suites": "testrail", "runs": "off", "milestones": "off", "fields": "off" }}Invalid body (an unknown entity, a mode that does not exist)
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, or no TestRail is connected
object
Example
{ "error": "no TestRail is connected"}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"}