Can I use wget to download attachments?

We are using a JIRA web site as a transfer point between two companies and a particular ticket to pass patches back and forth. (I won't go into the politics as to why this is so. Suffice it to say that this vehicle was chosen as the result of a negotiating process.) Anyway, as you might suspect, the list of stuff I need to pull gets long. I got what I thought was a list of URL's to pull, only to discover wget had pulled 30 copies of a java script intended to bring up a "where do you want this" helpful window. Not what I want. How do I just get the files without all the extra UI help? Thank you!

3 answers

1 accepted

Don't know about that, but you may find JIRA Command Line Interface useful. Specifically getAttachment and getAttachmentList

I went to your "JIRA Command Line Interface" link and confess I found it confusing. There are a lot of entries there with no clear ordering or way to decide which one it is I want. I guess this one: -- I'll know in a bit. Thank you! ``Get lastest'' I found to be a fun term. :)

It takes a little getting used to, but it works like a charm. Thank you. A tiny nit: "$@" will _always_ expand to at least one parameter. If it is empty, the program sees one empty argument. ${1+"$@"} is a little geeky, but expands to nothing when there are no arguments.

$ cat 

# Comments
# - Customize for your installation, for instance you might
# want to add default parameters like the following:
# java -jar `dirname $0`/lib/jira-cli-3.1.0.jar --server
# http://my-server --user automation --password automation "$@"

server='--server http://jira-..../'
passwd='--user automation --password automation'
jar="-jar $(dirname $0)/lib/jira-cli-3.1.0.jar"
java $jar $server $passwd ${1+"$@"}

Yes, you can. You can use bash `wget`, `curl` or whatever tool suits you. But not without any preparation. You have to use WebDav Servlet. So, assuming we are talking about confluence cloud and domain: ``, your URL would be:

This would get you "dashboard" view. If you want to download attachment 'samplefile' on space 'EXAMPLE' under page `subsite`, with tree as follows:

├── home
│   └── subsite
└── test

Your URL would look like:

Example in bash, using `wget`:

$ wget --user=test.user --ask-pass

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

812 views 3 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you