list_attachments
Fetch attachments for a test case, test run, test result, or one step; each record returns the id for deletion and the URL for download.
Instructions
List the attachments of a test case, test run (cycle), test result, or of one step of a case or result (GET /testcase/{key}[/step/{i}]/attachments, /testrun/{key}/attachments, /testresult/{id}[/step/{i}]/attachments). Addressing: 'test_case' needs testCaseKey, 'test_run' needs testRunKey, 'test_result' needs testResultId (numeric); an identifier that does not match the target is rejected. stepIndex is accepted for 'test_case' and 'test_result' only — API v1 has no per-step attachments endpoint for runs. These endpoints take no pagination and no fields projection — the full list always comes back. Step attachments are aggregated ASYMMETRICALLY (verified live): the test-case list EXCLUDES attachments that live on the case steps, while the test-result list INCLUDES them — so enumerating a case's evidence needs one extra call per step, and doing the same on a result double-counts. An out-of-range stepIndex answers 404 (an in-range step with no attachments answers []), and a testResultId that does not exist answers [] rather than 404, unlike a bogus test case or run key. Returns the API's array of attachment records as-is; each record carries the numeric id delete_attachment needs and the url download_attachment accepts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes | Entity family the attachment belongs to; it decides which identifier is required | |
| stepIndex | No | 0-based index of 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 (PROJ-C123 on older instances) — 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 (execution) id — an id, NOT a key; returned by create_test_result, update_last_test_result and get_test_run_results — required when target is 'test_result' |