Hi all,
I am currently implementing the solution posted by @TheSwilliam in this thread: https://powerusers.microsoft.com/t5/General-Power-Automate/Adding-the-attachments-to-Azure-DevOps-work-item-in-quot-Create/td-p/308759
I have been having some difficulties however actually getting the attachments to upload, and I'm hoping someone here might be able to see the issue with my flow.
Error in question:
Unable to process template language expressions in action 'Send_an_HTTP_request_to_Azure_DevOps' inputs at line '0' and column '0': 'The template language function 'binary' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.
I believe the issue is because ContentBytes doesn't exist (anymore?). @nerfherder has an apparent solution in this thread: https://powerusers.microsoft.com/t5/General-Power-Automate/Adding-the-attachments-to-Azure-DevOps-work-item-in-quot-Create/td-p/308759/page/3 - but I'm not sure I understand what is happening as the structure looks entirely different. I'd also prefer a solution that doesn't involve handling every possible extension type, but it if it's what is required so be it.
The file I am trying to upload is a test .xlsx file, which I've attached to this topic. However, it won't always be this file type. It could be an image of any format, or it could be a PDF.
Below I will include each section of my flow up to the point it fails. The flow works perfectly when there isn't an attachment.
Trigger:

Condition checking the subject (not relevant, the bug was present before I added this):

Parse JSON:

Schema:
{
"type": "object",
"properties": {
"Id": {
"type": "string"
},
"Name": {
"type": "string"
},
"ContentBytes": {
"type": "string"
},
"ContentType": {
"type": "string"
},
"Size": {
"type": "integer"
}
}
}
Send an HTTP Request to Azure DevOps:

Binary Function:
binary(body('Parse_JSON')?['ContentBytes'])
Entire Flow Overview:

Let me know if there is any further information required.
Any advice that could point me in the right direction would be greatly appreciated.
PB