I need to add multiple attachments to multiple issues. We imported legacy data but the attachments did not get added. I am using the following: https://thepluginpeople.atlassian.net/wiki/spaces/JEMHC/pages/112427088/Bulk+Update+JIRA+Issues+via+REST
It processes the correct issues but does not add the attachments.
The REST API command that I am using is: curl -D- -u "$1":"$2" --cacert cert-ca.cer -X POST --data @input.json -H "Content-Type: application/json" "$JIRAURL/rest/api/2/issue/$3/attachments"
My test input.json looks like this: [{"issue":"SFSR-109849","LogicalName":"image001.png","LastModifiedDate":"2018-05-21T12:39:50"},{"issue":"SFSR-109849","LogicalName":"image002.png","LastModifiedDate":"2018-05-21T12:39:50"},{"issue":"SFSR-109849","LogicalName":"image003.png","LastModifiedDate":"2018-05-21T12:39:50"},{"issue":"SFSR-130520","LogicalName":"image001.png","LastModifiedDate":"2019-10-24T20:34:48"},{"issue":"SFSR-138836","LogicalName":"image001.png","LastModifiedDate":"2020-06-19T14:22:01"},{"issue":"SFSR-138836","LogicalName":"image002.png","LastModifiedDate":"2020-06-19T14:22:01"}]
I don't receive an error, the attachments just don't get added. The only reason I can think of is it does not know the location of the attachments. I have tried putting the attachments in the same directory as the script, in the import/attachments directory, etc. The directory for the attachments is formatted like:
SFSR\SFSR-138836\image002.png
SFSR\SFSR-138836\image001.png
SFSR\SFSR-109849\image002.png
SFSR\SFSR-109849\image003.png
SFSR\SFSR-109849\image001.png
SFSR\SFSR-130520\image001.png
Any suggestions would be greatly appreciated.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.