Skip to main content
Glama
SmartBear

SmartBear MCP server

Official
by SmartBear

QTM4J: Link Test Cases to Requirement

qtm4j_link_test_cases_to_requirement

Link test cases to a Jira requirement in QTM4J using test case keys or filter criteria to establish traceability between requirements and tests.

Instructions

Link test cases to a Jira requirement in QTM4J by test case keys or filter criteria. Test case keys are resolved to internal IDs automatically.

Toolset: Requirements

Parameters:

  • requirementKey (string) required: Jira requirement key (e.g., 'SCRUM-1'). Resolved to the internal Jira issue ID automatically.

  • testCaseKeys (array): Test case keys to link (e.g., ['SCRUM-TC-1', 'SCRUM-TC-2']). Resolved to internal IDs and latest versions automatically. Provide this OR filter — not both.

  • filter (object): Filter criteria to select test cases to link. Use instead of testCaseKeys when selecting by criteria. projectId is auto-filled from the active project context.

  • sort (string): Sort order for filter results in 'field:asc|desc' format (e.g., 'key:asc'). Allowable fields: key, summary, created, updated, estimatedTime, status, priority, latestVersionNo, flakyScore, passRateScore.

Output Description: Confirmation with the requirement key and linked: true. Warnings included if any test cases could not be resolved or linked.

Use Cases: 1. Link specific test cases to a Jira story or bug by requirement key 2. Build traceability between Jira requirements and QTM4J test cases 3. Link all test cases matching a filter to a requirement 4. Associate test cases with a requirement as part of sprint planning

Examples:

  1. Link two test cases by key

{
  "requirementKey": "SCRUM-1",
  "testCaseKeys": [
    "SCRUM-TC-10",
    "SCRUM-TC-11"
  ]
}

Expected Output: Test cases linked to requirement SCRUM-1

  1. Link test cases matching a filter

{
  "requirementKey": "SCRUM-1",
  "filter": {
    "priority": [
      "High"
    ],
    "status": [
      "To Do"
    ]
  }
}

Expected Output: Filtered test cases linked to requirement

  1. Link test cases in a specific folder

{
  "requirementKey": "SCRUM-5",
  "filter": {
    "folderId": 42,
    "withChild": true
  },
  "sort": "key:asc"
}

Expected Output: Folder test cases linked to requirement

Hints: 1. PREREQUISITE: set_project_context must be called before this tool. NEVER auto-select a project. 2. REQUIREMENT KEY FORMAT: '{PROJECT_KEY}-{number}' — e.g. 'SCRUM-1'. 3. TEST CASE KEY FORMAT: '{PROJECT_KEY}-TC-{number}' — e.g. 'SCRUM-TC-145'. 4. Provide either testCaseKeys or filter — not both. 5. projectId in filter is auto-filled from the active project context — do not set it manually. 6. filter.excludeRequirementId excludes test cases already linked to that requirement ID. 7. If a test case key cannot be resolved, it is reported in warnings and other test cases are still linked.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sortNoSort order for filter results in 'field:asc|desc' format (e.g., 'key:asc'). Allowable fields: key, summary, created, updated, estimatedTime, status, priority, latestVersionNo, flakyScore, passRateScore.
filterNoFilter criteria to select test cases to link. Use instead of testCaseKeys when selecting by criteria. projectId is auto-filled from the active project context.
testCaseKeysNoTest case keys to link (e.g., ['SCRUM-TC-1', 'SCRUM-TC-2']). Resolved to internal IDs and latest versions automatically. Provide this OR filter — not both.
requirementKeyYesJira requirement key (e.g., 'SCRUM-1'). Resolved to the internal Jira issue ID automatically.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
linkedNo
unlinkedNo
requirementKeyYes
Behavior4/5

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

Annotations indicate a mutation tool (readOnlyHint=false) and description confirms linking with internal ID resolution. It mentions warnings for unresolved links, prerequisites, and output format. Could be more explicit about idempotency, but overall good.

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?

Well-structured with sections, front-loaded action, examples, and hints. A bit lengthy but each part adds value. Could be slightly more concise by omitting redundant parameter re-listings, but it's acceptable.

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

Completeness4/5

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

Covers prerequisites, usage, error handling (warnings), and examples. Lacks explicit handling of conflicting parameters (both testCaseKeys and filter) but the hint advises against. Output schema exists, so return values are not fully explained here but acceptable.

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. The description adds value by explaining resolution of keys, auto-fill of projectId, mutual exclusivity, and filter.excludeRequirementId hint. Examples further clarify usage.

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?

The description clearly states the action 'Link test cases to a Jira requirement' with two methods (by keys or filter). It distinguishes itself from its sibling 'qtm4j_link_requirements_to_test_case' which performs the reverse operation.

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 provides explicit use cases and prerequisites (e.g., set_project_context must be called first). It hints at mutual exclusivity of testCaseKeys and filter. However, it does not explicitly compare with the reverse sibling tool, leaving some implicit differentiation.

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

Install Server

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