Trace work item links
trace_linksBuilds a bounded, cycle-safe trace tree from a Polarion Work Item across multiple link levels, with direction and depth caps, returning nodes, edges, and truncation status.
Instructions
Builds a bounded, cycle-safe trace tree from one Work Item and returns {nodes, edges, truncated}. Requires a project ID and Work Item ID readable by the signed-in Polarion user. Use this to traverse multiple link levels; use getLinkedWorkItems or getBacklinkedWorkItems for a single hop. direction selects outgoing, incoming, or both; the result is marked truncated when the depth or node cap limits traversal.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | Maximum number of link hops from the root; defaults to 3 and is capped at 6. | |
| roles | No | Optional allowlist of link role IDs; omitted means include every role. | |
| node_cap | No | Maximum number of distinct Work Items to include; defaults to 200 and is capped at 1000. | |
| direction | No | `down` follows outgoing links, `up` follows backlinks, and `both` traverses both directions; defaults to `both`. | both |
| projectId | Yes | Project ID that owns the root Work Item, such as `PROJECT`. | |
| workItemId | Yes | Root Work Item ID within the project, such as `WI-123`, without the project prefix. |