I have been searching online for a while and I've not found a solid answer to this (lots of partial answers, though). Still nothing I do works.
I'm trying to write a powershell script to send attachments to JIRA using cURL (have not found another way that I can get to work).
My cURL command is:
C:\opt\curl\curl.exe -u user:pa$$word -X POST -H "X-Atlassian-Token: nocheck" -F "file=@C:\opt\attachments\75391_testingPNG.png" http://jira.ourURL.com/rest/api/2/issue/75391/attachments
This works perfectly from the command line. Anytime I try to run it via powershell it bombs out. Seems like it should be very easy to do, though. Just want to grab the files from a directory and send them to JIRA.
Anyone have any thoughts about this??? Thanks!
Community moderators have prevented the ability to post new answers.
With some assistance from someone on StackOverflow, we figured this out.
Start-Process C:\opt\curl\curl.exe -argumentList "-u", "user:pa`$`$Word", "-X", "POST", "-H", "`"X-Atlassian-Token: nocheck`"", "-F", "`"file=`@C:\opt\attachments\75391_testingPNG.png`"", "http://jira.ourURL.com/rest/api/2/issue/75391/attachments"
Glad you figured it out, @Charles Bastian. Another option – just for future reference – is the JIRA Command Line Interface (CLI) add-on, which allows you to do anything that is exposed by JIRA's APIs. Its supported actions include addAttachment, getAttachment, getAttachmentList, removeAttachment, runFromAttachmentList, and many more.
Thanks so much to everyone who joined for our July Appy Hours! Product and project management presenter highlights Checkout - Procurement and asset manager, presented by @Vincent Mutambuki ...