Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira CLI -- how to bulk upload attachments?

Bryan Karsh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 13, 2014

Hi,

Thanks to tips from Bob in the past, I know how to download all attachments for all issues from a filter... something like this:

./jira.sh --action runFromIssueList --filter delta-migration-test --common "--action runFromAttachmentList --issue @issue@ --common \"--action getAttachment --issue @issue@ --file \"\"target/@issue@/@attachment@\"\" \" "

Which gets me something like:

target/FOOBAR-123/example.txt

target/FOOBAR-1232/example.pdf

target/FOOBAR-1232/another-one.docx

....

Seems like there should be a way do something similar with an upload. Short of having Jira cli connect for each attachment, any tips? I wish I could just swap "getAttachment" with "addAttachment" and call it a day! :)

One other thing -- is there a way to take the output from getAttachmentList, and upload via that? Didn't see any examples for that.

1 answer

1 accepted

0 votes
Answer accepted
Bob Swift
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 13, 2014

For upload, you need a script (or a csv file produced by a similar script) to look through the directory and files for ones that you want as attachments and then some how map them to a corresponding issue id. The script can drive the addAttachment command or produce a csv file with the same information and drive it with runFromCsv.

Bryan Karsh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 2, 2014

Great -- thanks -- works like a charm!

Dharanitharan December 5, 2018 edited

@Bryan Karsh

Hi Bryan,

        Can you please share the command or script that works for you

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, confluence, loom, atlassian intelligence, ai notes, ai-powered meeting notes, atlassian community events, ace, confluence ai, loom ai integration, ai note-taking, atlassian ai features, team '25, atlassian live learning, confluence automation

Unlock AI-powered meeting notes: Join our live learning session! 📹

Did you catch the news at Team ‘25? With Loom, Confluence, Atlassian Intelligence, & even Jira 👀, you won’t have to worry about taking meeting notes again… unless you want to. Join us to explore the beta & discover a new way to boost meeting productivity.

Register today!
AUG Leaders

Atlassian Community Events