Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow upload Attachments to WI #25

Open
allburov opened this issue Mar 12, 2018 · 7 comments
Open

Allow upload Attachments to WI #25

allburov opened this issue Mar 12, 2018 · 7 comments

Comments

@allburov
Copy link
Member

allburov commented Mar 12, 2018

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")
@myksaquino
Copy link

i am getting error: 'Workitem' object has no attribute 'attach'

is this still working?how can i add ".msg" file as attachment to WIT?

@allburov
Copy link
Member Author

@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 :)

@myksaquino
Copy link

we were able to read and download attachments for WIT but unable to attach to WIT...hopefully this can be added ASAP.

@ondrno
Copy link
Contributor

ondrno commented Dec 30, 2018

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

@orihomie
Copy link

orihomie commented May 3, 2019

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?

@Boltyk
Copy link
Member

Boltyk commented May 3, 2019

@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

@aderbas
Copy link
Contributor

aderbas commented May 11, 2022

No update about this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

6 participants