Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Install plugin into Jira using UPM REST API

Vasiliy Krokha [Ciklum] September 1, 2013
Does it possible to Install plugin into Jira using UPM REST API, does that API exist at all?

7 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

6 votes
Answer accepted
BenW
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 2, 2013

Hi Vasiliy,

Take a look at the following documentation. Although this document is tailored for an Atlassian Connect add-on, the same API works for installing a Plugins 2 plugin (e.g. a .jar file) through UPM. In the final step, provide your .jar location instead of the ${plugin-xml-url} property.

https://developer.atlassian.com/display/AC/Registering+Add-ons#RegisteringAdd-ons-Registeringanadd-onusingtheRESTAPI ***edit, doc moved***

https://developer.atlassian.com/market/faqs/installing-an-add-on

Cheers,
Ben

10 votes
Robin Stocker
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 24, 2016

As Ben mentioned, there is a REST API that allows to install plugins. Here's an example of how to use it on the command line (using basic auth):

url="http://admin:admin@localhost:2990/jira/rest/plugins/1.0/"
token=$(curl -sI "$url?os_authType=basic" | grep upm-token | cut -d: -f2- | tr -d '[[:space:]]')
curl -XPOST "$url?token=$token" -F plugin=@path-to-plugin.jar

Adjust url and path-to-plugin.jar as necessary.

BenW
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 25, 2016

Nice idea to inject the token as such.

Stefan Kleineikenscheidt _K15t_
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.
May 11, 2016

I found Robin's command not working on cloud, but this one does work for AC addons:

url="https://<username>:<password>@<instancename>.atlassian.net/rest/plugins/1.0/"; token=$(curl -sI -H "Accept: application/vnd.atl.plugins.installed+json" "$url?os_authType=basic" | grep upm-token | cut -d: -f2- | tr -d '[[:space:]]'); curl -X POST -v -d '{ "pluginUri" : "<addon-base-url>/atlassian-connect.json"}' -H "Content-type: application/vnd.atl.plugins.remote.install+json" "$url?token=$token"
Like kornesh likes this
Mark L. Smith
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.
November 15, 2018

We wrapped this up into a Java based utility: https://github.com/BigBrassBand/installapp

Andrew Perlitch January 4, 2019

I am using v7 of jira and had to exclude the `jira` portion of the URL:

url="http://admin:admin@localhost:2990/rest/plugins/1.0/"

 Hope this helps someone.

2 votes
Dick Visser January 2, 2017

Hi

I'm able to install add-ons through the UPM GUI on our Confluence Server (non cloud).

We have a need to script the installation of a fair number of plugins - so without clicking through the web UI, and the REST API is the way to go.

All the add-ons we use are through the Marketplace (Gliffy, several Bob Swift add-ons, Balsamiq, Confiforms, etc).

The docs are not clear as to what I exactly need per add-on. Some mention just a URL to a plugin XML file which seems to end with atlassian-plugin.xml.

Other docs mention doing a POST and uploading a JAR file via a form field - but in that case how do I get hold of the plugin JAR file (or URL)?

 

How can I achieve this?

Many thanks

Dick Visser

 

 

 

 

0 votes
Robert Reiner _smartics_
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.
March 1, 2019

I know the discussion is a little old, but:

We released a plugin for Maven today to integrate the deployment of apps to Confluence (we have not tested this on any other Atlassian products, including JIRA) using the REST API.

The plugin is open source, licensed under the Apache License V2.

Please note that this is the first release and we are still pre-1.0. So expect some rough edges.

More on this release at Apptools Maven Plugin 0.8.0 or the plugin's website.

0 votes
Takayuki Hirota October 18, 2016

https://developer.atlassian.com/market/faqs/installing-an-add-on

An article about "Installing an add-on using the REST API" is helpful.

Is there anyone who knows solution about "Uninstalling an add-on using the REST API"?

 

wadey
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 18, 2016

This may help (note that it's not official API documentation at this time, just a HOWTO guide): https://ecosystem.atlassian.net/wiki/display/UPM/UPM+REST+API

Takayuki Hirota October 18, 2016

Hi Nick,

Thanks for your comment.

Unfortunately, that documentation does not provide information about uninstalling plugins.

BenW
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 19, 2016

I updated Nick's linked page to include uninstallation information.

Cheers,
Ben 

Takayuki Hirota October 19, 2016

Thanks smile

It works!

0 votes
Taiwo Akindele
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 1, 2013

Hi Vasily,

Yes, there is a UPM Rest API: https://ecosystem.atlassian.net/wiki/display/UPM/UPM+REST+API. However, I don't think it provides facility to install plugins to JIRA.

Basically, you should just be able to manage installed plugins: retrieve plugin details, enable/disable etc.

I hope this helps.

Vasiliy Krokha [Ciklum] September 1, 2013

Hi Taiwo,

Thanks for your reply, looks like API doesn't support install/delete indeed.

The end problem I'm trying to solve is the following:

As plugin developer I'd like to launch different version of JIRA app in the cloud and then automate installation of new version of the plugin, run automated tests etc.

But now my idea seems to be ruined )) unless there is no any solution to install plugins remotely in any way.

Vasiliy

Picky August 6, 2019

Hi Taiwo, 

 

I'm trying to installplugin through UPM API, I'm getting 403 error even though I have system admin access. However delete plugin works fine with same ID. 

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events