Skip to content

manage_attachments

Manage Azure DevOps work item attachments. List attachments on a work item, upload new files, and download existing attachments.

ActionDescriptionRequired ParamsOptional ParamsWrite
listList attachments on a work itemwork_item_idproject_keyNo
uploadUpload a file and attach to a work itemwork_item_id, file_pathproject_key, commentYes
downloadDownload an attachment by URLurlNo
ParameterTypeDescription
actionstringRequired. The action to perform: list, upload, download
project_keystringProject name
work_item_idintegerWork item ID (required for list, upload)
file_pathstringAbsolute path to the file to upload (required for upload)
commentstringOptional comment for the attachment (for upload, defaults to “Uploaded via adtk”)
urlstringAttachment URL (required for download)
{
"action": "list",
"project_key": "MyProject",
"work_item_id": 42
}
{
"action": "upload",
"project_key": "MyProject",
"work_item_id": 42,
"file_path": "/home/user/screenshots/bug-screenshot.png",
"comment": "Screenshot showing the error"
}
{
"action": "download",
"url": "https://dev.azure.com/myorg/_apis/wit/attachments/abc123-def456"
}