How to install an app in Jira using REST API
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. 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
This article provides a way to install or upgrade an app in Jira via REST API. The method can be useful in cases where this operation is not possible using the UI.
Environment
Jira 9.x.x
Solution
To begin, you must obtain the UPM token. One way to achieve this is by using Postman to send a GET request to the URL endpoint <Jira_base_url>/rest/plugins/1.0/?os_authType=basic.
Make sure to include the following header parameters in the request:
X-Atlassian-Token: nocheck
Accept: application/vnd.atl.plugins.installed+json
You should employ an authentication method, such as basic authentication.
The 200 OK response will contain in the body a list of Jira plugins.
Within the response header, you will find the parameter upm-token along with a numerical value, potentially paired with a hyphen, for instance, -51193575813259566:
Upon completion, the application upload process must be executed at the URL endpoint <Jira_base_url>/plugins/1.0/?token=<upm_token_from_previews_results> through a POST method. Please replace <upm_token_from_previews_results> with your specific value obtained in the previous step, such as -51193575813259566 in the example provided.
Before initiating the POST request, ensure the following header parameters are configured:
X-Atlassian-Token: nocheck
Content-Type: application/vnd.atl.plugins.install.uri+json
Accept: application/json
The body of the request can be in form-data format and include the following parameters:
plugin: @"<path_to_jar_or_obr_app_file>"
Remember to replace <path_to_jar_or_obr_app_file> with the actual path, for instance /jira/xproduct-admin-ui-plugin/xproduct-admin-ui-plugin/target/xproduct-admin-ui-plugin-1.0.0.obr. A successful upload will return a 200 OK response, like the following:
To ensure the plugin was correctly installed, follow these steps:
Navigate to Jira Administration > Manage apps > Manage apps.
In the search filter, choose User-installed.
The recently uploaded plugin should be visible there, displaying the accurate version.
For further information, please refer to Register apps.