Skip to main content
Glama

recreate_test_run_with_items

Destructive

Recreate an immutable Jira test run under a new key with added or removed test cases, a new name or folder, and optional result copying or source deletion.

Instructions

Recreate a test run (cycle) under a NEW key with a changed item list, name or folder (GET /testrun/{key} + POST /testrun, plus DELETE /testrun/{key} when deleteOriginal=true). API v1 limitation: a test run is IMMUTABLE — there is no PUT /testrun, so it cannot be renamed, moved or have cases added/removed through the public API; its items are fixed at creation and the run status is derived from item statuses. Escape hatches: recreate_test_run_with_items (public, new key) or the internal-API tools update_test_run / add_test_cases_to_run / remove_test_cases_from_run (same key, require ZEPHYR_ALLOW_INTERNAL_API=true). Items of the new run are: the source items in their original order, minus removeTestCaseKeys, plus addItems appended; of the source items only the planning fields (testCaseKey, environment, assignedTo) are carried over when copyResults is false — all read-only item data is dropped. The new run gets a NEW key and nothing that referenced the old one is updated. Header fields not passed explicitly are inherited from the source run (a JSON null there counts as absent) — EXCEPT testPlanKey, which GET /testrun does not report at all, so the new run starts with no plan association unless you pass it (or re-link with link_test_run_to_plan). A run cannot carry Jira issue links at all: issueLinks is rejected locally, and any value the source run reports is dropped rather than forwarded — link the issues on the test cases instead. removeTestCaseKeys filters the SOURCE items only: a key that also appears in addItems is still added. deleteOriginal runs only after POST /testrun succeeded, so a failed create leaves the source run untouched. copyResults=true carries each kept case's LAST execution over as the initial result of its item, while the item's own environment/assignedTo still win — but GET /testrun reports each item MERGED with its latest execution, so an item whose configured environment/assignedTo were not repeated in that execution has already lost them before this tool reads the run; set them explicitly through addItems when specific values matter. Copied per-step scriptResults are sanitized: this API stores the execution of a case without a STEP_BY_STEP script as an index-less stub, and POST /testrun requires an index on every entry, so entries without a usable index are numbered by position or dropped. removeTestCaseKeys is a SILENT filter (keys that are not items of the run, including nonexistent ones, are ignored), addItems does NOT deduplicate (adding a case that is already an item creates a second item for it, after which test results for that case need matchEnvironment/matchUserKey), and removing every item is allowed and produces a valid run with zero items. The source run survives unless deleteOriginal=true, and is never deleted when creating the new run failed. Returns { key, originalKey, itemCount, copiedResults, deletedOriginal } plus copyResultsNote when result copying hit its page cap. copiedResults counts the KEPT SOURCE items that had a last execution — including the 'Not Executed' execution the server writes for every item at creation, so it is not a count of real executions; addItems entries are never counted, even when they carry a status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoName of the new run (defaults to the source run's name)
ownerNoOwner (defaults to the source run's value). Jira *user key* (e.g. 'JIRAUSER10000'), NOT a username or e-mail — resolve it with find_jira_user.
folderNoFull path of an existing TEST_RUN folder starting with "/", e.g. "/Regression" (defaults to the source run's folder). The folder MUST already exist.
versionNoVersion name (defaults to the source run's value)
addItemsNoExtra items appended AFTER the kept source items. Each item requires testCaseKey and may carry full execution result fields (status, environment, executedBy, assignedTo, comment, executionTime, actualStartDate, actualEndDate, customFields, issueLinks, scriptResults).
iterationNoIteration name (defaults to the source run's value)
issueLinksNoNOT SUPPORTED for test runs and rejected locally: the API has no such field on its run DTO, so any value (an empty array included) makes POST /testrun answer HTTP 500 and create nothing. Link them with link_issues_to_test_run (internal API) or on the test cases (create_test_case / update_test_case with issueLinks).
testRunKeyYesKey of the SOURCE test run to recreate, e.g. PROJ-R123 (PROJ-C123 on older instances)
copyResultsNoCarry the LAST execution of each kept source item over as the initial result of the new run (default false)
testPlanKeyNoTest plan to associate the new run with, e.g. PROJ-P123 (defaults to the source run's value)
customFieldsNoCustom field values keyed by field name (defaults to the source run's values)
deleteOriginalNoPermanently DELETE the source run with all its execution results after the new run was created successfully (default false). The source run is never deleted otherwise, and never when creating the new run failed.
plannedEndDateNoISO 8601 (defaults to the source run's value)
plannedStartDateNoISO 8601, e.g. 2026-07-20T09:00:00Z (defaults to the source run's value)
removeTestCaseKeysNoSource items whose test case key is in this list are DROPPED from the new run, e.g. ["PROJ-T5"]

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.5

TDQS

A4.8/5.0
Behavior5/5

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

Annotations supply only destructiveHint=true; the description carries the full behavioral burden and does so richly: DELETE runs only after a successful POST, the source survives otherwise and never on failure, issueLinks is rejected locally, removeTestCaseKeys is a silent filter, addItems does not deduplicate, removing all items is allowed, and copied scriptResults are sanitized. This is far beyond what the annotation provides.

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

Conciseness4/5

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

Front-loaded with the core purpose and justified in length by 15 parameters and numerous gotchas, so most sentences earn their place. It is dense single-paragraph prose that would read better with light structuring, and the 'source run survives / never deleted on failure' point is restated near the end after being stated earlier.

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 15-param mutation tool with nested objects and no output schema, the description is complete: it documents the return shape ({key, originalKey, itemCount, copiedResults, deletedOriginal} plus copyResultsNote), the semantics of copiedResults, and every destructive/failure edge case an agent needs before calling.

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 coverage is 100%, so baseline is 3, but the description adds genuine meaning beyond the schema: unspecified header fields inherit from the source run (with JSON null counting as absent), testPlanKey is not reported by GET /testrun so the new run starts plan-less, removeTestCaseKeys filters source items only, and addItems entries are appended without dedup. These interactions and edge cases go past the per-field schema text.

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 ('Recreate a test run (cycle) under a NEW key') with precise scope (changed item list, name, folder) and grounds it in the actual endpoints used. It explicitly distinguishes itself from siblings update_test_run / add_test_cases_to_run / remove_test_cases_from_run and explains the immutability constraint that forces this tool to exist.

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?

Gives explicit when-to-use guidance: the API v1 immutability limitation, the two escape hatches (this public tool with a new key vs the internal-API tools on the same key), and the ZEPHYR_ALLOW_INTERNAL_API=true prerequisite for the latter. An agent can pick the right tool without inference.

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