How to remove Application Link (AppLinks) via REST API
プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。
このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
症状
Unable to add add-on via UPM due to the Application Link still remaining after a previous installation or want to programatically remove an Application Link without accessing JIRA UI.
診断
Each application link is identified via the following REST call. Run this curl command to identify the Application Links available:
curl -s -X GET -u <user>:<pass> -H "Accept: application/json" <hostname>/rest/applinks/1.0/listApplicationlinks | python -mjson.tool
ソリューション
In this example we will try to remove the JIRA application link with the id from the example above: 2841b105-5904-3c0a-9710-1ff26ae88206
The profile used for the deletion does require 'jira-administrators' permission
curl -X DELETE -u <username>:<password> -H "Accept: application/json" localhost:8080/rest/applinks/1.0/applicationlink/2841b105-5904-3c0a-9710-1ff26ae88206
{"message":"Deleted application with id '2841b105-5904-3c0a-9710-1ff26ae88206'","status-code":200}
A successful deletion will always return a 200 message code.
Reviewing the Application Links in the UI via {JIRA Home}/plugins/servlet/applinks/listApplicationLinks will confirm the removal of the Application Link.