I've created a Microsoft Flow, to triggered an event when Outlook email arrived, to create a new "User Story" WorkItem in Azure DevOps, attaching the files from Outlook to the Attachments tab.
Microsoft Flow "When a new email arrives" with the values,
Importance Any, Has Attachment Yes and Include Attachments Yes.
The next step is "Apply to each"
Select an output from previous steps: Attachments
"Send an HTTP Request to Azure DevOps"
Filling the required fields
Account Name: myaccountname
Method: POST
Relative URI: myprojectname/_apis/attachments?fileName=Attachments Name&api-version=5.0
Body: "[BINARY FILE CONTENT]"
("Attachments Name" is a dynamic content)
I've added a "Parse JSON" Content: Current item Schema:
The last step
"Create a new work item"
Account Name: myaccountname
Project Name: myproject
Work Item Type: User Story
Title: Subject
Description: Body
Other Fields
Enterkey field: System.AttachedFiles
Entervalue field: Attachments Name (dynamic content)
For the Schema:
{
"type": "object",
"properties": {
"Id": {
"type": "string"
},
"Name": {
"type": "string"
},
"ContentBytes": {
"type": "string"
},
"ContentType": {
"type": "string"
},
"Size": {
"type": "integer"
}
}
}
Expected result: Attach the Outlook files to Azure DevOps User Story work item into the attachments tab.
Actual result: The file is not attached.
There is not an error message.
First Step