web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Copy attachments betwe...
Power Automate
Answered

Copy attachments between items in DevOps

(0) ShareShare
ReportReport
Posted on by 4

Hi there.

 

I had a flow that when the user fills a "New Demand Request" (a new item I created in DevOps, like a little interview between P.O. and user), the flow create a User Story using what has been inputed by the user in a template description.

 

But, I can't figure out how to transfer the attachments that user eventually upload in "New Demand Request" to the "User Story" using the flow. I had tried some ways to see if I can get this exposed through DevOps actions and triggers, but with no lucky.

 

So I need help. Is there anyone that gone through this problem and found a solution?

 

Categories:
  • Expiscornovus Profile Picture
    33,997 Most Valuable Professional on at

    Hi @jg_lopes,

     

    This should be possible by using the Send an http request to Azure DevOps and Get Attachment method from the Azure DevOps Rest API:

    https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/attachments/get?view=azure-devops-rest-6.0

     

    attachments.png

  • Verified answer
    Expiscornovus Profile Picture
    33,997 Most Valuable Professional on at

    For the upload part you can follow the steps from this blog. From the Post the Attachment to DevOps REST API part. I have tested it myself and it works pretty good:

    https://www.fidelityfactory.com/blog/2019/10/14/use-ms-flow-to-add-an-attachment-in-azure-dev-ops

     

    To demonstrate that example I have tested all the steps.

     

    1. Get the source Work Itemgetworkitem.png

     

    2. Get attachment of source Work Item

    getattachment.png

    3. Upload attachment as new attachment. The body is the output of step two.

    uploadattachment.png

    4. Create new work item with new attachment as related item. Below is a sample body for this request. Don't forget that the content-type for this request is a bit different. Btw, you could also parse the json of step 3 to extract the attachment url.

    [
     {
     "op": "add",
     "path": "/fields/System.Title",
     "value": "Test Title"
     },
     {
     "op": "add",
     "path": "/relations/-",
     "value": {
     "rel": "AttachedFile",
     "url": "yourattachmentfileurlfromstep3",
     "attributes": {
     "comment": "Test Comment"
     }
     }
     }
    ]

     

    createworkitem.png

  • jg_lopes Profile Picture
    4 on at

    Thanks @Expiscornovus !

     

    Works like a charm. I'd obviously to made some changes to work in my flow, but at the end this post had clarify for me some concepts behind Power Automate and made me study more the Azure APIs.

     

    So, I made a mix between "Create a item" and use of some GET, POST and PATCH through "send a http request", but at the end of the day, everything works!

     

    Regards,

     

    Juliano

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 424

#2
11manish Profile Picture

11manish 328 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard