Add or remove work item artifact link
devops_work_item_artifact_link_updateAttach or detach Pull Request, build, commit, branch, changeset, or versioned item links to Azure DevOps work items by specifying work item ID, link type, and artifact ID.
Instructions
Add or remove an artifact link (Pull Request, Build, Commit, Branch, Changeset, Versioned Item) on a work item. Use op='add' (default) to attach, op='remove' to detach. The artifact_id format depends on link_type (see parameter doc).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"work_item_id": "<work_item_id>",
"link_type": "<link_type>",
"artifact_id": "<artifact_id>"
},
"name": "devops_work_item_artifact_link_update"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | No | Operation to perform: 'add' (default) to attach the artifact link, 'remove' to detach it. | add |
| comment | No | Optional comment to attach to the link. Only used when op='add'. | |
| link_type | Yes | Supported: 'Pull Request', 'Build', 'Found in build', 'Integrated in build', 'Commit', 'Branch', 'Changeset', 'Versioned Item'. | |
| artifact_id | Yes | Artifact identifier — format depends on link_type: Git-based (Pull Request / Commit / Branch / Versioned Item): '{project_id}/{repo_id}/{detail}', where project_id and repo_id are GUIDs (use devops_repository_get to resolve names), and detail is the PR number, commit SHA, branch name, or file path respectively. Build / Found in build / Integrated in build: '{build_id}'. Changeset: '{changeset_id}'. | |
| work_item_id | Yes | The numeric ID of the work item to modify. | |
| validate_only | No | If True, validate without saving (dry run). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |