Skip to main content
Glama
SmartBear

SmartBear MCP server

Official
by SmartBear

QTM4J: Link Bugs to Test Step Execution

qtm4j_link_bugs_to_test_step_execution

Links Jira bugs to a specific test step execution by looking up the step from test cycle, test case, and sequence number. Supports single or bulk linking with optional JQL filter.

Instructions

Link Jira bug keys to a test step execution. Looks up testStepExecutionId from testCycleKey, testCaseKey, and step sequence number; resolves bug keys to numeric defect IDs automatically.

Toolset: Test Executions

Parameters:

  • testCycleKey (string) required: Test cycle key in the format '{PROJECT_KEY}-TR-{number}', e.g. 'SCRUM-TR-101'. Used directly as the API path parameter.

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

  • testStepSeqNo (number) required: sequence number of the test step within the test case (e.g. 2 = the second step).

  • defectIDs (any): Jira issue keys of the bugs to link (e.g. ['PROJ-456', 'PROJ-789']). Pass Jira keys — not numeric IDs. Required if filter.jql is not provided; duplicates removed automatically.

  • filter (object): JQL filter to select which bugs should be linked. Use instead of or in addition to defectIDs.

  • returnLinkedDefectCount (boolean): When true, the response includes linkedDefectCount (the number of bugs linked). Defaults to true. (default: true)

Output Description: Confirmation object with testCycleKey, testCaseKey, linked: true, and linkedDefectCount (by default). warningMessages is included when the server reports per-bug issues.

Use Cases: 1. Link one or more Jira bugs to a specific test step execution in a single request, supporting both single and bulk linking operations.

Examples:

  1. Link a bug to step 2 of a test case execution

{
  "testCycleKey": "PROJ-TR-101",
  "testCaseKey": "PROJ-TC-42",
  "testStepSeqNo": 2,
  "defectIDs": [
    "PROJ-456"
  ]
}

Expected Output: { testCycleKey: 'PROJ-TR-101', testCaseKey: 'PROJ-TC-42', linked: true, linkedDefectCount: 1 }

  1. Link multiple bugs to step 3 and suppress defect count

{
  "testCycleKey": "PROJ-TR-101",
  "testCaseKey": "PROJ-TC-42",
  "testStepSeqNo": 3,
  "defectIDs": [
    "PROJ-456",
    "PROJ-789"
  ],
  "returnLinkedDefectCount": false
}

Expected Output: { testCycleKey: 'PROJ-TR-101', testCaseKey: 'PROJ-TC-42', linked: true }

  1. Link bugs to a step using a JQL filter

{
  "testCycleKey": "PROJ-TR-101",
  "testCaseKey": "PROJ-TC-42",
  "testStepSeqNo": 1,
  "filter": {
    "jql": "project = PROJ AND status = Open"
  }
}

Expected Output: { testCycleKey: 'PROJ-TR-101', testCaseKey: 'PROJ-TC-42', linked: true, linkedDefectCount: 2 }

Hints: 1. Call set_project_context before this tool. 2. An execution must already be started for the test case before bugs can be linked. 3. If the user provides a JQL expression, pass it as the filter.jql field. Correct or normalize JQL before calling if needed — the handler passes it through unchanged.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNoJQL filter to select which bugs should be linked. Use instead of or in addition to defectIDs.
defectIDsNoJira issue keys of the bugs to link (e.g. ['PROJ-456', 'PROJ-789']). Pass Jira keys — not numeric IDs. Required if filter.jql is not provided; duplicates removed automatically.
testCaseKeyYesTest case key in the format '{PROJECT_KEY}-TC-{number}', e.g. 'SCRUM-TC-145'.
testCycleKeyYesTest cycle key in the format '{PROJECT_KEY}-TR-{number}', e.g. 'SCRUM-TR-101'. Used directly as the API path parameter.
testStepSeqNoYessequence number of the test step within the test case (e.g. 2 = the second step).
returnLinkedDefectCountNoWhen true, the response includes linkedDefectCount (the number of bugs linked). Defaults to true.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
linkedYesTrue — confirms the link request was accepted.
testCaseKeyYesTest case key of the execution the bugs were linked to (e.g. 'SCRUM-TC-145').
testCycleKeyYesTest cycle Key of the execution the bugs were linked to (e.g. 'SCRUM-TR-101').
warningMessagesNoPer-bug warnings reported by the server (e.g. a bug key not accessible in Jira). Present only when issues occurred; the remaining bugs are still linked.
linkedDefectCountNoNumber of bugs successfully linked. Present when returnLinkedDefectCount is true (default).
Install Server

TDQS

A4.3/5.0
Behavior4/5

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

The description adds meaningful behavior beyond the annotations: it automatically resolves Jira keys to numeric defect IDs, removes duplicates, passes JQL through unchanged, and includes linkedDefectCount by default. It also warns that warningMessages appears when the server reports per-bug issues, giving the agent useful expectations about side effects and responses.

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?

The description is well-organized with clear sections, but the Parameters section largely duplicates the input schema descriptions. The examples and hints are useful and justify some length, so the verbosity is mostly purposeful, though redundancy with the schema keeps it from being concise.

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 complex tool with nested objects, multiple input modes, and prerequisite state, the description is unusually complete: it provides parameter formats, output shape, working examples, and explicit prerequisites. Nothing essential for correctly invoking the tool 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 coverage is 100%, so the baseline is 3, but the description adds value through concrete examples for single bug linking, multi-bug linking, and JQL-filter linking. It also reinforces important distinctions like passing Jira keys rather than numeric IDs and the default behavior of returnLinkedDefectCount.

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 opening sentence uses a specific verb and resource: 'Link Jira bug keys to a test step execution,' which clearly differentiates this from sibling tools like qtm4j_link_bugs_to_test_case_execution. The description also explains the lookup mechanism for testStepExecutionId, leaving no doubt about the tool's scope.

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 Hints section explicitly says to call set_project_context first and states that an execution must already be started before linking bugs. It also clarifies when filter.jql can be used instead of defectIDs. It does not explicitly name alternatives, but the prerequsites and execution context make appropriate usage clear.

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