Attach uploaded file
create_attachment_from_uploadFinalise an attachment upload started with prepare_attachment_upload: pass the same target (objectType + ids + field/step) plus the fileKey, fileName, contentType and fileSize. Links the file to the object; for a rich-text field, a test-case step, the result comment (inline) or a run-result step (stepPosition) it also embeds the image inline. A run-result step image is listed under that step in get_run_case_details (results[].steps[].files); a result-level file is listed in results[].files. RESULT_BUSY means nothing was attached; the same call can be repeated after a few seconds.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"objectType": "<objectType>",
"project": "<project>",
"fileName": "<fileName>",
"contentType": "<contentType>",
"fileSize": "<fileSize>",
"fileKey": "<fileKey>"
},
"name": "create_attachment_from_upload"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| runId | No | TEST_RUN_RESULT: the test run id. | |
| inline | No | TEST_RUN_RESULT only: true embeds the image inline in the result's notes/comment; false (default) attaches it as a result file. Ignored when a step is named. | |
| fieldId | No | Rich-text field id (from get_fields). TEST_CASE: required - a TEXT field of the case's template, or its STEPS field together with stepPosition; other field types are refused. The image is embedded in that field's rich text, so a TEXT field that held plain text then holds a rich-text document with the same text (displayValue shows both). TEST_RUN_RESULT: optional, a TEXT result field such as "Actual Result". | |
| fileKey | Yes | The fileKey returned by prepare_attachment_upload. | |
| project | Yes | Project id the object belongs to. Numeric project id as returned by get_projects (the number in the app URL); a project name is not accepted. | |
| fileName | Yes | Original file name. | |
| fileSize | Yes | File size in bytes. | |
| resultId | No | TEST_RUN_RESULT / TEST_SESSION_RESULT: the result id. | |
| sessionId | No | TEST_SESSION_RESULT: the exploratory session id. | |
| stepField | No | TEST_CASE STEPS field only: sub-cell to embed into (step_1=Step, step_2=Data, step_3=Expected, step_4=Notes). Defaults to step_3. | |
| stepIndex | No | Older form of stepPosition: the zero-based step, so stepIndex 0 is step 1 (stepPosition = stepIndex + 1). If both are given they must name the same step. | |
| objectType | Yes | Target object type. | |
| testCaseId | No | TEST_CASE: the test case id (required for TEST_CASE). | |
| contentType | Yes | MIME type, e.g. image/png. | |
| stepPosition | No | Step number, 1-based, as get_run_case_details returns it in steps[].position. TEST_CASE STEPS field: the step row to embed into. TEST_RUN_RESULT: the step whose note gets the image; it is listed under that step in get_run_case_details (results[].steps[].files), not in results[].files. Omit for a result-level file. |