How to download Atlassian Marketplace apps through the command line
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Many users want to automate the download of Apps (plugins) for Jira, Confluence or other Atlassian products.
This article provide examples on how to do that.
These apps are downloaded as either OBR or JAR files.
Environment
Linux-like terminal (Linux, macOs or cygwyn)
Internet connectivity to marketplace.atlassian.com (port 443)
Solution
Here's the steps layout:
- Find the desired app through a browser on the Marketplace
- Copy the download URL
- Write the command
1) Find the app
First, access https://marketplace.atlassian.com/ through a browser and search for the app you want to download.
Click on Versions then on See all ... versions.
Some apps are "hidden" from the Marketplace because they're either bundled into newer version of the Products or download/installed in other way.
Here's a list of useful apps/products not indexed in the Marketplace search:
- Advanced Roadmaps for Jira (formerly Portfolio)
- Jira Service Management (formerly Jira Service Desk)
- Jira Software (in case your main installation is Jira Core or Jira Service Management)
(see How to download Jira through the Command Line for a similar approach to download the main installers for Jira)
Hidden or deprecated apps
Some apps may be hidden from the marketplace. If this is the case, you can append ?includeHiddenVersions=1
to the URL to list the versions, like in:
2) Copy the URL
On the Version history page, look for the version you want to download, right-click the mouse on the Download link and copy the link.
It should look something like: https://marketplace.atlassian.com/download/apps/1212137/version/800701050
3) Write the command
Simply downloading the resource through curl
or wget
will create a file named after the last part of the URL: "800701050" in this case.
This is unlikely ideal, so we can output the download to the filename specified by the redirected URL:
$ curl -s -I -L https://marketplace.atlassian.com/download/apps/1212137/version/800701050 -s | grep content-disposition | egrep -o '".*"' | tr -d '"'
insight-8.7.10.obr
We can now include this command in the output parameter of curl
or wget
:
$ curl -L https://marketplace.atlassian.com/download/apps/1212137/version/800701050 -o `curl -s -I -L https://marketplace.atlassian.com/download/apps/1212137/version/800701050 -s | grep content-disposition | egrep -o '".*"' | tr -d '"'`
$ wget -O `curl -s -I -L https://marketplace.atlassian.com/download/apps/1212137/version/800701050 -s | grep content-disposition | egrep -o '".*"' | tr -d '"'` https://marketplace.atlassian.com/download/apps/1212137/version/800701050
These commands will download the file and create it as the same filename as specified in the content-disposition
header attribute.
See Also
Installing, Uninstalling, Upgrading and Downgrading Marketplace Apps on Confluence using REST API