We're creating simple integration between two Jira instances (cloud and server) using Automation for Jira app:
When an issue created (updated) on Jira cloud it sends to Jira server webhook so we can create an issue, update issue fields on Jira server. But what about attachments? We can't figure out what to do with attachments. The REST API documentation says that webhooks does not contain the attachment itself but contains a URI that can be used to download the actual attached file.
Can we use this URI in "REST API "Add attachment POST /rest/api/2/issue/{issueIdOrKey}/attachments" to attach file in Jira server?
Curl example:
curl -D- -u admin:admin -X POST -H "X-Atlassian-Token: no-check" -F "file=@myfile.txt" http://myhost/rest/api/2/issue/TEST-123/attachments
If it's impossible to implement via Automation for Jira app what we can use? Maybe script runner or power script?