Hi,
For a simple integration between 2 systems (Jira <> Not Jira), we are using Automation rules to push data from one side to the other.
95% of the stuff we're trying to do works fine using the "send web request" and "incoming webhook" triggers, but we're having some issues with Attachments.
Initially we divided it up in to 2 scenario's:
- Incoming Attachments
- Outgoing Attachments
and unfortunately each has it's own set of challenges.
For the incoming attachments we had to figure out how to transform a base64 string in to something that the Atlassian REST API's would accept and had to pivot to writing an Azure function that we call from Automation that then adds the attachment to the needed work item.
For the outgoing attachments we are facing other challenges and for that I wonder if someone has advice on the following questions.
- How do we trigger an Automation to run when an Attachment is added? There is no real "attachment added trigger" but according to the documentation a "Field value changed" trigger on the field Attachment should also work? In my personal experience it doesn't trigger when I add an attachment.
- If we somehow trigger the "adding of an attachment" it seems to be added as comment each time (that's ok) but how do we know how many attachments were added at once? Mainly because this could be a comment that was added with multiple inline images. Using Automation, we can use the {{attachment}} smartvalue and also get the {{attachment.last}} but we have no idea of knowing how many attachments we need to get..
- How do we get the content of an attachment? The smart value also allows for {{attachment.last.content}} to be used but that just returns a content url which we of course can call again to get the attachment itself. Is there an easier way to this?
For 3. we might need to just write another Azure function to call the content url and push it to the other system, but that of course has no way of succeeding if we cannot trigger an action and sequentially know which attachment(s) to get..
Anybody got some ideas? If we can solve 1. I feel we might need to move entirely to a Azure function to see what was added in the last x minutes and pull the data.
I don't want to move to a marketplace app to do this since we need to be able to make this as generic as possible to eventually integrate with multiple (legacy) systems.