Download a work item attachment
download_attachmentDownload a work item attachment to a local folder using its ID or unique file name. Automatically avoids overwriting existing files and returns the saved file's absolute path.
Instructions
Download a work item attachment to a local directory by attachment id or unique file name. Existing files are never overwritten (a " (n)" suffix is added). Returns the absolute path of the saved file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Exact server-side file name. Works only when the name is unique on the work item; otherwise pass attachmentId. | |
| project | No | Team project name or ID used for the attachment endpoints. Defaults to the work item's own project, then to AZURE_DEVOPS_PROJECT. | |
| fileName | No | Local file name to save as; defaults to the server-side name. Existing files are never overwritten; a " (n)" suffix is added. | |
| outputDir | No | Directory to save into; defaults to AZURE_DEVOPS_DOWNLOAD_DIR, then to the server's working directory. | |
| workItemId | Yes | Work item ID (unique within the collection). | |
| attachmentId | No | Attachment GUID as returned by list_attachments (the last segment of the attachment URL). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| name | Yes | ||
| path | Yes | ||
| size | Yes | ||
| workItemId | Yes |