Power Automate - Create Azure DevOps WorkItem and Attachments

Sdílet
Vložit
  • čas přidán 20. 12. 2022
  • This video explains how to create a work item in Azure DevOps and add attachments.
    Upload attachments
    /_apis/wit/attachments?filename=@{items('Apply_to_each')?['name']}&api-version=5.1
    Content-Type
    application/octet-stream
    Link WorkItem with attachments
    /_apis/wit/workitems/@{outputs('Create_a_work_item')?['body/id']}/?api-version=5.1
    Content-Type
    application/json-patch+json
    [
    {
    'op': 'add',
    'path': '/relations/-',
    'value': {
    'rel': 'AttachedFile',
    'url': '@{body('Parse_JSON')?['url']}',
    'attributes': {
    'comment': 'Bug details',
    'name':'@{items('Apply_to_each')?['name']}'
    }
    }
    }
    ]
    Microsoft Documentation
    learn.microsoft.com/en-us/res...
    For multiple attachments please see this.
    powerusers.microsoft.com/t5/B...
    Update:
    Some of you getting errors regarding attachments cannot open. I believe its a bug.
    So do the following:
    Change the version from 5.1 to 5.0
    /_apis/wit/attachments?filename=@{items('Apply_to_each')?['name']}&api-version=5.1
    Then under the body use expression
    binary('here map the email attachment content bytes')
    Set the Body is Base64 to Yes
    This should work. I have tested this.
    Thanks

Komentáře • 106

  • @user-jg7tt7lx2z
    @user-jg7tt7lx2z Před 11 měsíci +1

    Thank you , very helpful

  • @hash4162
    @hash4162 Před rokem +1

    Thank you so much 👌

  • @DG-fy5df
    @DG-fy5df Před 10 měsíci +1

    This is so helpful

  • @shubhambajpai7897
    @shubhambajpai7897 Před rokem +1

    really helpful

  • @markbishop2738
    @markbishop2738 Před rokem +1

    Do you know of a way to add an attachment to a task in DevOps IF you are using a HTTP request and not a "Create Item" action and not using email? (I'm using only a send http request to create a new task using JSON and API bypass, but I can't figure out how to add an attachment).

    • @abm4975
      @abm4975  Před rokem

      Hi Mark
      I haven't explored that yet.
      Thanks

  • @kerravon280
    @kerravon280 Před 8 měsíci +1

    Very helpful! Thanks! I am using this with a Microsoft Form. Flow runs without errors but the attachments can't be opened. Any ideas?

    • @abm4975
      @abm4975  Před 8 měsíci

      See in my video details. I have mentioned a fix for this.

  • @jonaskoniger3337
    @jonaskoniger3337 Před 19 dny

    can someone help me? I am still getting the corrupted files only.
    I have a trigger comming from a powerapp getting the file
    The code in the body is:
    binary(triggerBody()?['file']?['contentBytes'])
    base64 is set to yes.
    Can anyone help me?

  • @eliciawilkinson
    @eliciawilkinson Před 4 měsíci +1

    Hi there, thank you for this tutorial it is very helpful! I'm a little stuck on the bug fix suggestion to use the expression
    binary('here map the email attachment content bytes')
    Could you go into bit more detail on how you map the email attachment content bytes?
    Thank you!

    • @abm4975
      @abm4975  Před 4 měsíci

      Hi
      Thanks for your kind comments. So thats the expression I am talking about. I need to see you flow. I could offer a screenshare help. You can connect me via teams. My contact email is under the channel about section.
      Thanks

  • @camilacaracciolo5516
    @camilacaracciolo5516 Před rokem +1

    Excelent. Ihave a question. How can I get the name an other properties of files attached of a work item in azure, export all of this in an excel, just with a flow in power automate?

    • @abm4975
      @abm4975  Před rokem

      Hi
      So do you want to get all the files attached from all the work item? Also please mention which are the specific properties you looking for?
      Thanks

  • @iretioluwasaheed838
    @iretioluwasaheed838 Před rokem +1

    Hello, can you help me with a project.
    I need to use power automate to send reminder emails to a particular email if a client's medical update is due. We have an excel sheet that contains each client's due date and their emails to notify them. How do I do it?

    • @abm4975
      @abm4975  Před rokem

      Hi
      I have made a video based on your request. Here it is.
      czcams.com/video/puR70yQMJKE/video.html
      Thanks

  • @pujaladva2707
    @pujaladva2707 Před 11 měsíci +1

    This is awesome, but was wondering if you had a video about integrating Service Now with DevOps using Power Automate? :)

    • @abm4975
      @abm4975  Před 11 měsíci +1

      Hi @pujaladva2707
      I don't have a subscription for service now. Do you need license for this? If you can provide me a demo link I could have look at this.
      Please let me know.
      Thanks

  • @sowmyanandamuri3245
    @sowmyanandamuri3245 Před rokem +1

    This wonderful but I am facing issue in last action stating : the request indicated a Content-Type of "application/json" for method type "PATCH" which is not supported Valid content types for this method are: application/json-patch+json

    • @abm4975
      @abm4975  Před rokem

      Hi Sowmya
      Check your mapping properties. Make sure you have the right schema names.
      Thanks

  • @projectgoodvibesonly
    @projectgoodvibesonly Před rokem +1

    Thank your for the helpful video. I find that on trying to download and open the attachments from the newly created work item, it appears the attachments are corrupted and do not open, irrespective of the type of attachment. Also any inline images (email body) are not loading. Please advise ..

    • @abm4975
      @abm4975  Před rokem +1

      Hi
      Check the email connector properties whether you enabled the attachments to yes. Please let me know.
      Thanks

    • @projectgoodvibesonly
      @projectgoodvibesonly Před rokem

      @@abm4975 - I have ‘Include Attachments’ as Yes .. and ‘Only with Attachments’ as No. Is this what you are referring to? The attachments are appearing in the new work item (right files, size etc.) but when you try to view / download the files it says content is corrupted.

    • @abm4975
      @abm4975  Před rokem

      Hi
      Looks like you got the right settings. What's the file type (pdf, .xlsx, docx). You could contact me via my channel about section. I could have a look via screenshare. If not please post a screenshot in Power Automate community and tag me as @abm. I will have a look.
      powerusers.microsoft.com/t5/Microsoft-Power-Automate/ct-p/MPACommunity
      Thanks

    • @abm4975
      @abm4975  Před 11 měsíci

      Hi
      I found a work around for the error you are getting
      Follow the below steps
      Change the version from 5.1 to 5.0
      /_apis/wit/attachments?filename=@{items('Apply_to_each')?['name']}&api-version=5.1
      Then under the body use expression
      binary('here map the email attachment content bytes')
      Set the Body is Base64 to Yes
      This should work. I have tested this.

    • @paritoshbapat1492
      @paritoshbapat1492 Před 5 měsíci

      @@abm4975 does this work for Excel format also as iam not able to do so

  • @TRbeyazlotus
    @TRbeyazlotus Před 5 měsíci

    Hi thanks for the video. I have a question: When a new mail received, we can create new devops. But when someone replies the same mail, power automate create a copy of this mail as a new story. How can i stop this? I don't want to create new devops items for followup mails.

  • @mohammednizamuddin1348
    @mohammednizamuddin1348 Před rokem +1

    Hello abm, Im having an issue where my project does not show up under Project Name in the connector. I am added as an admin to the project within ADO. Any suggestions please

    • @abm4975
      @abm4975  Před rokem +1

      Hi
      Thanks so much for the support.
      I was away for few weeks. Do you still need help in this please?
      Thanks

  • @BrantPierce
    @BrantPierce Před rokem +1

    The walkthrough is amazing. I am getting the attachments as corrupted files after uploading. I see others with the same issue were you able to solve the problem?

    • @abm4975
      @abm4975  Před rokem

      Hi
      Thanks so much for the support.
      I was away for few weeks. Do you still need help in this please?
      Thanks

    • @BrantPierce
      @BrantPierce Před rokem +1

      @@abm4975 no I'm using a work around with SharePoint

    • @abm4975
      @abm4975  Před 11 měsíci +1

      Hi
      I found a work around for the error you are getting
      Follow the below steps
      Change the version from 5.1 to 5.0
      /_apis/wit/attachments?filename=@{items('Apply_to_each')?['name']}&api-version=5.1
      Then under the body use expression
      binary('here map the email attachment content bytes')
      Set the Body is Base64 to Yes
      This should work. I have tested this.

  • @dikshabhattacharjee7173
    @dikshabhattacharjee7173 Před rokem +1

    Great video.Can this be achieved when a Microsoft form with an attachment is submitted?

    • @abm4975
      @abm4975  Před rokem

      Hi
      Yes it is possible. I have another video about From attachments but not specific to DEVOPS. Have a look and if you need further help please let me know.
      Thanks

  • @CiamS
    @CiamS Před rokem +2

    This is awesome. Appreciate the clear walkthrough. Strangely, however, I can't get around the base64 error. I've duplicated your steps and everything works as you saw with the attachment that won't actually open. When I change to base64 = yes, though, i just get the error. If you figure out what is actually happening I'd love to know. :)

    • @abm4975
      @abm4975  Před rokem

      Hi @Ciams
      Not sure why you couldn't get around that error. For me it's working fine.
      Thanks

    • @kbeichler77
      @kbeichler77 Před rokem

      Hi Ciam, I have had the same problem. My investigation shows the following: I had an Object instead of the raw file to upload. The Content in the previos step was like:
      {
      "$content-type": "application/pdf",application/octet-stream
      "$content": "JVBERi0xLjQKJeLjz9M...... ......hgghg"
      }
      In that case you need to put the object to a compose step, then create a second compose with the following code: outputs('Compose')['$content']
      Now you can upload the output of Compose2 as base64 encoded file to DevOps
      Hope that helps

    • @hash4162
      @hash4162 Před rokem

      Hi @ciam, I basically followed what @abm as shown in the video here, I came across the same issue, so here is what I did to get the attachments to work items I basically added the get attachments action in apply to each action and them compose action with the expression, here is the expression (base64(base64ToBinary body('Get_Attachment_(V2)')? 'contentBytes']))
      and then I passed that output as a body in http post request. That’s it
      It then basically creating attachments, multiple attachments from an email also if there is any image in the email body then it also attaches it as attachments and if the email body have any links then it will create hyperlinks which is click

    • @notimeleft8169
      @notimeleft8169 Před rokem +2

      What worked for me (I used Sharepoint Get Attachments > Get attachment contents) is to use the expression base64('Insert attachment contents here') in the Body of the first HTTP action.

    • @abm4975
      @abm4975  Před 11 měsíci

      Hi @Ciams
      I found the issue regarding the attachments. Do the following please
      Change the version from 5.1 to 5.0
      /_apis/wit/attachments?filename=@{items('Apply_to_each')?['name']}&api-version=5.1
      Then under the body use expression
      binary('here map the email attachment content bytes')
      Set the Body is Base64 to Yes
      This should work. I have tested this.
      Let me know how it goes.
      Thanks

  • @user-yt9ni2is4m
    @user-yt9ni2is4m Před 9 měsíci +1

    Hi, thanks a lot i really like the video!
    Unfortunately i have the issue with base64.
    Status now:
    in "POST-Request" base64=no
    in "PATCH-Request" base64=no
    Result:
    Attachements are on my work-item.
    Problem:
    Attachements are empty or cant be open locally.
    Can you please explain this:
    "Then under the body use expression
    binary('here map the email attachment content bytes')
    Set the Body is Base64 to Yes"

    • @abm4975
      @abm4975  Před 9 měsíci

      Hi
      Happy to look via a screenshare. Check my Channel about section and connect me via teams.
      Thanks

    • @user-yt9ni2is4m
      @user-yt9ni2is4m Před 9 měsíci +1

      Its solved men thanks :)

  • @mch3486
    @mch3486 Před rokem +1

    Good Day
    I like your Idea
    Currently I'm searching for a solution:
    - The Pictures inside the E-mail are not taken over, they are broken
    - --> So I was thinking, is it possible to "add" the E-mail which is created to an Work Item also to add itself as an attachment?

    • @abm4975
      @abm4975  Před rokem +1

      Hi
      Please have a look at this
      powerusers.microsoft.com/t5/General-Power-Automate/Save-email-to-Sharepoint-document-library-full-email/td-p/4440
      Thanks

  • @himanath
    @himanath Před rokem +1

    When people reply to the email.. how can we update the same work item instead of creating a new item whenever someone replies to the same email.

    • @abm4975
      @abm4975  Před rokem

      Hi @himanath
      Good question. Its going to be a tricky one. You need the work item id for the update. In my opinion its not possible to update from replies of the same emaik.
      Thanks

    • @michelejohnson2556
      @michelejohnson2556 Před rokem

      May also need to use the conversation ID from the email. So, if a reply is made on that conversation (thread) then add it to the same work ID.
      Create a log with conversation ID to work ID; maybe in Excel or filter array. When an email comes in, check the conversation/work ID log. Then when another email comes in, check to see if the conversaion ID exists in your log. If yes, add new email to the coresponding work ID, else create an new work ID.
      Let me know if you figure this out

  • @abdulbasithshaik3614
    @abdulbasithshaik3614 Před rokem +1

    Is it technically possible to automate a task in power automation whenever a person is mentioned in the azure devops boards in description field ,That mentioned person should get a message in microsoft teams indicating someone is trying to contact him azure devops boards.

    • @abm4975
      @abm4975  Před rokem

      The challenge is how you going to extract that persons name from description field unless all of your description might have same pattern. Its a tough one.

    • @abdulbasithshaik3614
      @abdulbasithshaik3614 Před rokem

      @@abm4975 can we do it by script saying that whenever something starts with '@'

  • @lummyguerrero6197
    @lummyguerrero6197 Před rokem +1

    I really appreciate your content; it is very good! By any chance, do you have a video to show how to duplicate User Stories or Tasks from one organization to another? I need to create a flow to duplicate everything. This means that from the moment a User Story or Task is created, all the updates made in the original, such as assignments, comments, descriptions, and attachments, need to be duplicated into my other organization. If you can help me with this, I would truly appreciate it! Thank you!

    • @abm4975
      @abm4975  Před 11 měsíci

      I haven't got a chance to look into this yet.

  • @Grimuka_Gamer
    @Grimuka_Gamer Před měsícem +1

    Hi thank for this amazing video, uri and headers are the same for windows microsoft forms?

    • @abm4975
      @abm4975  Před měsícem

      Hi
      Not sure what you meant by that?
      Thanks

    • @Grimuka_Gamer
      @Grimuka_Gamer Před měsícem +1

      ​@@abm4975 I have tried to replicate your video in a similar flow, the difference is that the trigger is from Microsoft Forms, and just get broken files arrive in my azure board, in the same way I do not get the apply to each automatically when the attachment field is set. microsft forms :(, u can make a video for microsoft forms :D?

    • @abm4975
      @abm4975  Před měsícem

      Good suggestion. Let me see. Thanks

    • @Grimuka_Gamer
      @Grimuka_Gamer Před měsícem

      @@abm4975 I would really appreciate it

    • @abm4975
      @abm4975  Před měsícem

      @Grimuka_Gamer, So what are the things you collect from MS Forms? Please explain a bit more about your requirement. Are you collecting image as well?

  • @johnrad22
    @johnrad22 Před 3 měsíci +1

    Thanks for the video. Is there a way to get the file from Onedrive or from my personal computer? Could you please create a tutorial on that?

    • @abm4975
      @abm4975  Před 3 měsíci +1

      There is already a connector or OneDrive (Personal and Business). Please have a look and let me know if you need any further help in this. For local machine yes can but you need to install Power Automate Gateway configuration.
      learn.microsoft.com/en-us/power-automate/gateway-reference

    • @johnrad22
      @johnrad22 Před 3 měsíci +1

      @@abm4975 thank you for your response. I've edited my comment to better express my question. Regarding OneDrive (Personal and Business), I'm struggling to build the flow correctly, and I'm unsure what I might be doing wrong.

    • @johnrad22
      @johnrad22 Před 3 měsíci +1

      @@abm4975 Thank you for your response. I've edited my comment to express myself more clearly. I'm having trouble completing my workflow using OneDrive Business, and I'm sure I'm missing something. Hence, the tutorial request.

    • @abm4975
      @abm4975  Před 3 měsíci

      Hi
      Please check my channel about section and contact me via email address. I could do a screenshare help and see the issue.
      Thanks

  • @user-kb4pp3ev1n
    @user-kb4pp3ev1n Před rokem +1

    Hi, in my case it does not work, if the base 64 field is set on YES the flow gives me the following errors:
    'Send_an_HTTP_request_to_Azure_DevOps' failed
    Unable to parse Base64 encoded bytes. clientRequestId:............
    The strange thing is that if I repeat the test with one of the automatic tests and I select a failed test, the flow works fine, this is very strange...
    Could someone tell me how to solve the problem? Thank you very much .

    • @abm4975
      @abm4975  Před rokem

      Hi,
      I haven't come across that error. If you have resolved the issue please let me know as well.
      Thanks

    • @Ladidar
      @Ladidar Před rokem

      I'm having the same issue, did you even find a fix?

    • @abm4975
      @abm4975  Před 11 měsíci

      Hi
      I found a work around for the error you are getting
      Follow the below steps
      Change the version from 5.1 to 5.0
      /_apis/wit/attachments?filename=@{items('Apply_to_each')?['name']}&api-version=5.1
      Then under the body use expression
      binary('here map the email attachment content bytes')
      Set the Body is Base64 to Yes
      This should work. I have tested this.

  • @bhargovtamuly6812
    @bhargovtamuly6812 Před měsícem +1

    I tried this for ms forms responses but it doesn't work

    • @abm4975
      @abm4975  Před měsícem

      There is a fix I applied. See my description in my video.

  • @paritoshbapat1492
    @paritoshbapat1492 Před 5 měsíci +1

    not able to do the same with EXCEL file anything around that

    • @abm4975
      @abm4975  Před 5 měsíci

      I haven't tried that. It should work.

  • @paulburkart6111
    @paulburkart6111 Před rokem +2

    I am finding that the attachments I add aren't uploading correctly. The size is always 0KB, but there are no errors in my flow. Is this an issue you ran into as well?
    Edit: This issue appears to be a bug with PowerAutomate itself. When you send the first email, it will always fail. Once you resubmit the test through PowerAutomate's testing functionality, it will work, despite the fact the requests are identical.

    • @abm4975
      @abm4975  Před rokem +1

      Hi Paul
      I need to see the Power Automate. Could you connect me via teams for a screenshare. See my contact details from the channel.
      Thanks

    • @paulburkart6111
      @paulburkart6111 Před rokem +1

      @@abm4975 I sent you an email with some redacted details of the flow

    • @abm4975
      @abm4975  Před rokem +1

      @@paulburkart6111 Thanks Paul. I have replied. Please check it.

    • @dikshabhattacharjee7173
      @dikshabhattacharjee7173 Před rokem +1

      Hi paul,abm
      I am facing the same issue.Were you able to resolve it?

    • @abm4975
      @abm4975  Před rokem

      Hi
      Make sure your Outlook connector attribute include attachments should set to Yes
      Thanks

  • @nandun11
    @nandun11 Před 11 měsíci +1

    This is a very helpful video, But i have a small issue my test is working but when i receive mail with attachments it is not visible in the attachments tab I would really appreciate it if you can look into this.

    • @abm4975
      @abm4975  Před 11 měsíci

      Hi
      Could you contact me via teams. Have a look on my channel about section for connecting via email.
      Thanks

    • @nandun11
      @nandun11 Před 11 měsíci

      @@abm4975 I have sent you an email regarding this.
      can you suggest a possible time

    • @nandun11
      @nandun11 Před 11 měsíci +1

      HI Ajith, Thank you so much for spending time on resolving my issue.
      your support is so much appreciated. Cheers!!!

    • @abm4975
      @abm4975  Před 11 měsíci +1

      Hi
      I found a work around for the error you are getting
      Follow the below steps
      Change the version from 5.1 to 5.0
      /_apis/wit/attachments?filename=@{items('Apply_to_each')?['name']}&api-version=5.1
      Then under the body use expression
      binary('here map the email attachment content bytes')
      Set the Body is Base64 to Yes
      This should work. I have tested this.

    • @abm4975
      @abm4975  Před 11 měsíci +1

      Thanks for your support.

  • @sakshigoyal8371
    @sakshigoyal8371 Před rokem +1

    This is a very helpful video. I can attach the attachments to the work item but cannot open the file attachments. It gives me an error the file type is not supported. @abm4975 @abm I would really appreciate it if you can look into this.

    • @abm4975
      @abm4975  Před rokem

      Hi
      Thanks so much for the support.
      I was away for few weeks. Do you still need help in this please?
      Thanks

    • @abm4975
      @abm4975  Před 11 měsíci

      Hi
      I found a work around for the error you are getting
      Follow the below steps
      Change the version from 5.1 to 5.0
      /_apis/wit/attachments?filename=@{items('Apply_to_each')?['name']}&api-version=5.1
      Then under the body use expression
      binary('here map the email attachment content bytes')
      Set the Body is Base64 to Yes
      This should work. I have tested this.