Allow upload Attachments to WI
May be, someone needs upload attachments to WI.
wi = client.get_workitem(ids=111)
attachment= wi.attach(filename="myfilename.txt", filepath="C:\Users\allburov\myfile.txt")
i am getting error: 'Workitem' object has no attribute 'attach'
is this still working?how can i add ".msg" file as attachment to WIT?
@myksaquino This feature has not yet been implemented, unfortunately. You can vote +1 and if there are many who wish, one of the maintainers will develop this feature. Or you can develop it and create pull request :)
we were able to read and download attachments for WIT but unable to attach to WIT...hopefully this can be added ASAP.
FYI, relevant API doc: https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/work%20items/update?view=azure-devops-rest-5.0#add_an_attachment
FYI, relevant API doc: https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/work%20items/update?view=azure-devops-rest-5.0#add_an_attachment
I suppose the trick is here:
{
"op": "add",
"path": "/relations/-",
"value": {
"rel": "AttachedFile",
"url": "https://dev.azure.com/fabrikam/_apis/wit/attachments/098a279a-60b9-40a8-868b-b7fd00c0a439?fileName=Spec.txt",
"attributes": {
"comment": "Spec for the work"
}
}
but it's unclear for me - how did they get that guid:
098a279a-60b9-40a8-868b-b7fd00c0a439
And internet says I must pass filestream to a 'fileName' parameter - then why do they pass filename + file extension there?
@orihomie you're going to get it as a response from upload attachment post:
https://docs.microsoft.com/en-us/azure/devops/integrate/previous-apis/wit/attachments?view=tfs-2015#upload-an-attachment
No update about this?