Skip to main content
Glama
SmartBear

SmartBear MCP server

Official
by SmartBear

QTM4J: Link Requirements to Test Case

qtm4j_link_requirements_to_test_case

Link Jira requirements to a test case in QTM4J by requirement keys or JQL filter. Automatically resolves keys to internal IDs for traceability.

Instructions

Link one or more Jira requirements to a test case in QTM4J by requirement keys or JQL filter. Requirement keys are resolved to internal IDs automatically.

Toolset: Test Cases

Parameters:

  • key (string) required: Test case key in '{PROJECT_KEY}-TC-{number}' format (e.g., 'SCRUM-TC-145'). Required.

  • versionNo (number): Test case version number. Defaults to the latest version.

  • requirementKeys (array): List of requirement keys to link (e.g., ['SCRUM-1', 'SCRUM-2']). Resolved to internal IDs automatically. Provide this OR filter.jql — not both.

  • filter (object): JQL filter to select requirements to link. Use instead of requirementKeys when filtering by JQL.

Output Description: Confirmation with the test case key, version number, and linked: true. Warnings are included if any requirements could not be resolved or linked.

Use Cases: 1. Link one or more Jira requirements (stories, bugs, epics) to a test case 2. Associate requirements with a test case using a JQL filter 3. Build traceability between requirements and test cases 4. Link requirements to a specific test case version

Examples:

  1. Link two requirements by key

{
  "key": "SCRUM-TC-145",
  "requirementKeys": [
    "SCRUM-1",
    "SCRUM-2"
  ]
}

Expected Output: Requirements SCRUM-1 and SCRUM-2 linked to test case

  1. Link requirements by JQL filter

{
  "key": "SCRUM-TC-145",
  "filter": {
    "jql": "project = DEMO AND issuetype = Story"
  }
}

Expected Output: Requirements matched by JQL linked to test case

  1. Link a requirement to a specific version

{
  "key": "SCRUM-TC-85",
  "versionNo": 2,
  "requirementKeys": [
    "SCRUM-10"
  ]
}

Expected Output: Requirement linked to version 2 of test case

Hints: 1. PREREQUISITE: set_project_context must be called before this tool. NEVER auto-select a project. 2. KEY FORMAT: '{PROJECT_KEY}-TC-{number}' — e.g. 'SCRUM-TC-145'. 3. Requirement keys follow the Jira issue key format: '{PROJECT_KEY}-{number}' (e.g. 'SCRUM-1'). 4. Provide either requirementKeys or filter.jql — not both. 5. If a requirement key cannot be resolved or linked, it is reported in warnings and other requirements are still linked. 6. versionNo defaults to the latest version. Use search_test_cases to find available versions if needed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesTest case key in '{PROJECT_KEY}-TC-{number}' format (e.g., 'SCRUM-TC-145'). Required.
filterNoJQL filter to select requirements to link. Use instead of requirementKeys when filtering by JQL.
versionNoNoTest case version number. Defaults to the latest version.
requirementKeysNoList of requirement keys to link (e.g., ['SCRUM-1', 'SCRUM-2']). Resolved to internal IDs automatically. Provide this OR filter.jql — not both.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYes
linkedYes
versionNoYes
Install Server

TDQS

A4.4/5.0
Behavior4/5

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

Beyond the annotations, the description explains automatic resolution of requirement keys to internal IDs, partial failure behavior (warnings with remaining links still applied), and versionNo defaulting to the latest version. This gives an agent a realistic mental model of side effects without contradicting the readOnlyHint=false annotation.

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?

The description is long but well organized with Parameters, Output Description, Use Cases, Examples, and Hints. It front-loads the core purpose and then provides operational details; some redundancy with the schema exists, but the structure makes the definition scannable.

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?

The definition covers prerequisites, key formats, parameter selection rules, defaults, warning/partial-failure behavior, and expected output. With a nested filter object and project-context dependency, this is sufficient context for an agent to invoke the tool correctly without external knowledge.

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?

Input schema already documents all four parameters at 100% coverage, but the description adds useful semantics: mutual exclusivity of requirementKeys/filter.jql, automatic ID resolution, and the default version behavior. Examples demonstrate concrete valid combinations.

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?

Description opens with a specific action ('Link one or more Jira requirements to a test case in QTM4J') plus the two mechanisms (requirement keys or JQL filter), making the operation's scope immediately clear. It also distinguishes from sibling qtm4j_link_test_cases_to_requirement and qtm4j_unlink_requirements_from_test_case by direction and verb.

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

Usage Guidelines4/5

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

The description gives explicit context: prerequisite set_project_context must be called first, and the agent must never auto-select a project. It also clearly states the mutual exclusion between requirementKeys and filter.jql and points to search_test_cases for version discovery, but it does not explicitly enumerate when a sibling should be chosen instead.

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

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SmartBear/smartbear-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server