upload_attachment
Upload a file as an attachment to a Zephyr Scale test case, test run, or test result. Optionally attach to a specific step of a test case or result.
Instructions
Upload a file as an attachment to a Zephyr Scale test case, test run (cycle) or test result — optionally to a single step (POST multipart/form-data to /testcase/{key}[/step/{i}]/attachments, /testrun/{key}/attachments or /testresult/{id}[/step/{i}]/attachments). Addressing: target 'test_case' requires testCaseKey (stepIndex optional to address a specific step); target 'test_run' requires testRunKey (no step addressing — the API has no per-step endpoint for runs); target 'test_result' requires testResultId (stepIndex optional). Pass ONLY the identifier that matches the chosen target. filePath must be an absolute path of a file ON THE MACHINE RUNNING THIS MCP SERVER (the file is read from local disk). Returns the attachment metadata reported by the API, or { uploaded, fileName, size } when the API responds with an empty body.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes | Kind of entity the attachment belongs to: test_case, test_run or test_result | |
| fileName | No | File name to store in Zephyr Scale; defaults to the basename of filePath | |
| filePath | Yes | Absolute path of the file to upload on the machine running this MCP server | |
| stepIndex | No | 0-based step index to address a single step instead of the whole entity (targets 'test_case' and 'test_result' only) | |
| testRunKey | No | Test run (cycle) key, e.g. PROJ-R123 — required when target is 'test_run' | |
| testCaseKey | No | Test case key, e.g. PROJ-T123 — required when target is 'test_case' | |
| testResultId | No | Numeric test result id — required when target is 'test_result'. Result ids are returned by create_test_result / update_last_test_result / get_test_run_results. |