Planning
edit_document
Write grantIdempotent
Change passages of a ticket's document as its next revision, all or none. Each old passage must appear exactly once in the revision you read; include more of the text around it when it does not. Up to 50 passages. Returns the document. Needs write access.
Inputs
ticketstringRequiredA ticket ID, such as WEB-31.
documentstringRequiredA document's name or slug from get_ticket, such as Plan or build-record.
editsarray of objectsRequiredThe passages to change.
At least 1 item
baseRevisionintegerRequiredThe revision you read with get_document: 0 for an unwritten document. A change from an older revision is refused; read it again and redo your change.
From 0 to 9,007,199,254,740,991
tools/callJSON-RPC
{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "edit_document", "arguments": { "ticket": "WEB-31", "document": "build-record", "edits": [ { "old": "## Decisions\n", "new": "## Decisions\n- Index at build time, not on request.\n" } ], "baseRevision": 4 } }}POST/clanker/v1/tickets:edit-document
curl -X POST https://api.clankership.com/clanker/v1/tickets:edit-document \ -H "Authorization: Bearer $CLANKER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "ticket": "WEB-31", "document": "build-record", "edits": [ { "old": "## Decisions\n", "new": "## Decisions\n- Index at build time, not on request.\n" } ], "baseRevision": 4 }'