Skip to main content
Glama

create_test_result

Record a new test execution result for a test case in a test run, appending to that item's execution history. Use to log status, comments and step results.

Instructions

Record a NEW execution of a run item (POST /testrun/{runKey}/testcase/{caseKey}/testresult). Appends to the execution history of that item — to amend the newest execution instead, use update_last_test_result. Only the fields you pass are sent, and the execution keeps the project default for everything you omit. The test case should already be an item of the run; if it is not, the behavior is VERSION-SPECIFIC — some Server builds silently ADD it to the run as a new item (verified live: testCaseCount grows; the new item's POSITION in items[] is not the head and not the tail — it landed second of three and second of four in two separate runs, so do not rely on where it appears), others reject the call with 400/404. Default statuses: 'Not Executed', 'In Progress', 'Pass', 'Fail', 'Blocked' — case-sensitive internal names; instances may define custom ones. scriptResults carry per-step outcomes of a STEP_BY_STEP script as { index (0-based), status, comment? }. An overall status sent TOGETHER with scriptResults is stored as sent (verified live: 'Blocked' with three 'Pass' steps stored 'Blocked') and is NEVER derived from the step statuses — scriptResults without a status leave the execution at the project default ('Not Executed'), so pass status in the SAME call. Some older builds may instead ignore the overall status: read the result back with get_test_run_results rather than sending a second update_last_test_result, which replaces the whole execution. A scriptResults entry whose index is past the last step of the case is discarded silently (HTTP 200, no error). When the same test case is an item of the run several times (e.g. once per environment or assignee), disambiguate with matchEnvironment / matchUserKey; with no selector the API picks one of them itself — measured live it took the FIRST (lowest-id) twin and left the other untouched, so pass a selector whenever the case appears more than once. Selectors only SELECT an existing item — they never set a value, so pass environment as well if the result should carry it. matchUserKey matches executedBy/userKey, not assignedTo. If nothing matches, this build answers 400 "No test execution found …" or an empty-bodied HTTP 500 — the 500 was first seen with matchEnvironment, but other inputs produce it too, so its cause is undetermined; that empty-bodied 500 has been observed to write the execution and add a duplicate item anyway, so the write may or may not have happened — re-read with get_test_run_results instead of retrying. Returns { id } of the created execution.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusNoExecution status. Default statuses: 'Not Executed', 'In Progress', 'Pass', 'Fail', 'Blocked' — case-sensitive internal names; instances may define custom ones.
commentNoComment (HTML allowed)
versionNoJira release version name the execution belongs to, e.g. "2026.7" (case-sensitive)
iterationNoIteration name as configured in the project (case-sensitive), for runs executed in iterations
assignedToNoAssignee. Jira *user key* (e.g. 'JIRAUSER10000'), NOT a username or e-mail — resolve it with find_jira_user.
executedByNoExecutor. Jira *user key* (e.g. 'JIRAUSER10000'), NOT a username or e-mail — resolve it with find_jira_user.
issueLinksNoJira issue keys to link, e.g. ["PROJ-123"]
testRunKeyYesTest run (cycle) key, e.g. PROJ-R123 (PROJ-C123 on older instances)
environmentNoEnvironment name as configured in the project (case-sensitive), e.g. "Chrome"
testCaseKeyYesTest case key, e.g. PROJ-T123 — should already be one of the run's items
customFieldsNoCustom field values keyed by field name
matchUserKeyNoRun-item selector, sent as the 'userKey' QUERY parameter (never in the body): targets the run item by its executor's Jira user key, e.g. 'JIRAUSER10000'.
actualEndDateNoISO 8601
executionTimeNoExecution duration in milliseconds
scriptResultsNoPer-step results (STEP_BY_STEP scripts)
actualStartDateNoISO 8601, e.g. 2026-07-20T14:00:00Z
matchEnvironmentNoRun-item selector, sent as the 'environment' QUERY parameter (never in the body): targets the run item with this environment (case-sensitive). Distinct from the 'environment' body field, which sets the environment recorded on the result.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.5

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description carries the full burden — and it does: version-specific auto-add behavior, silent discard of out-of-range scriptResults indices, status never being derived from step statuses, 400/404 and empty-bodied 500 responses, and the warning that a 500 may still have written the execution and duplicated an item. These are exactly the failure modes an agent must know before retrying.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded correctly — what it does, the sibling alternative, then hazards. But it runs to roughly 400 words with hedged speculation and low-value specifics ('it landed second of three and second of four', 'its cause is undetermined') that a caller cannot act on; a tighter version would preserve the actionable warnings and drop the field-report narrative.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 17-parameter mutation tool with nested scriptResults, no annotations and no output schema, the description closes every gap: it documents the return value ({ id }), the selector-vs-body distinction, and the recovery path (re-read with get_test_run_results rather than retry). Nothing an agent needs to call it safely is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is already 100%, so the baseline is 3. The description still adds real meaning beyond the schema: the status/scriptResults coupling rule, the fact that omitted fields keep project defaults, that selectors only select and never set (so `environment` must be passed separately if the result should carry it), and that matchUserKey targets executedBy, not assignedTo.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Record a NEW execution of a run item') and even names the endpoint, then immediately distinguishes itself from update_last_test_result, the sibling it is most likely to be confused with. An agent can route correctly without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit when-to-use vs. when-not: 'to amend the newest execution instead, use update_last_test_result', plus conditional guidance to pass matchEnvironment/matchUserKey whenever a case appears more than once, and to pass `status` in the same call as scriptResults. Alternatives and preconditions are named, not implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools