Automating Email Attachment Uploads to Azure DevOps Work Items via Power Automate
Published 2026-04-05
This article assumes you know how to implement the following steps first:
When a new email arrives (V3)- Outlook 365 actionCreate a work item- DevOps actionApply to eachusing Attachments list - Outlook 365 dynamic content itemSend HTTP POST request to DevOpsto upload the attachment file content - DevOps actionParse JSON- regular actionSend HTTP POST request to DevOpsto associate uploaded file to the work item - DevOps action
There is an issue at step 3. a where the attachment is being uploaded. Attachments can be of various content types, and additionally (but separately) you are having to decide whether the body is Base64 or not.
Steps:
- Organization Name - your org name
- Method - POST
- Relative URI -
/_apis/wit/attachments?filename=[Attachment Name dynamic content item]&api-version=7.1 - Headers - Only one header:
content-typeof valueitems('Apply_to_each')?['contentType'] - Body -
binary(items('Apply_to_each')?['contentBytes']) - Body is Base64:
Yes