Links, Applinks, and macros fail when copying Jira and Confluence to other environments
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
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.
*Fisheye および Crucible は除く
問題
Jira や Confluence を異なる環境に移動すると、ほとんどのテスト時に 2 つのインスタンス間のリンクが壊れます。新しい環境には別の URL があります。Jira の課題リンクと Confluence のページ リンクは従来の環境で定義されたアプリケーション リンクに依存しているため、この URL の影響を受けます。この問題に対応してリンクを自動的に更新するための、次の機能リクエストが起票されています。 - JRA-62850Getting issue details... STATUS
- Jira のプロジェクト インポートのソリューションには適用されません。
- Jira および Confluence Cloud のソリューションには適用されません。
Atlassian Cloud の URL 構造では、Confluence のオンプレミスのサーバー版と比較すると Confluence Cloud のページ iD にいくつかの変更があります。
原因
The new environment is using a different baseURL. Links and macros in JIRA and Confluence are dependent on the original baseURL.
When an applink between Jira and Confluence is created, it creates a record in the propertyvalue table using a GUID to define the relationship. If the serverID remains the same, the applinkID will remain the same, and the applink itself may show as working:
SELECT SUBSTR(a.property_key,16,36) as "appId", b.propertyvalue as "Application Name"
FROM propertyentry a join propertystring b on a.id=b.id where a.property_key like 'applinks.admin%name';
The values returned are as follows:
appid, app name
<GUID>,Confluence
The problem with the remote links and macros is that the URL has changed, and the values in the remotelink
table have not been updated to the new URL. You can verify this by running the following query in the Jira or Confluence instance where the links are not working:
SELECT * FROM remotelink WHERE URL is not null;
The returned information will show you that the <JIRA_URL> is still saved with the previous value:
Jira Issue: SCRUM-23 (ID; 10022)
global ID: <GUID>&pageId=1146882 (applink, confluence page id)
title = jira defined variable
url: <JIRA_URL>/confluence/pages/viewpage.action?pageId=1146882
app type =- confluence (com.atlassian.confluence)
ソリューション
Jira
オプション 1: Jira には優れた XML バックアップ ユーティリティがあり、XML バックアップにはデータが含まれます (推奨)
次の手順を利用して Jira のリンクを更新できます。これを実現するためのアプローチは次のとおりです。
- Jira のバックアップを作成します。「Jira のバックアップ」
- バックアップ ファイルを展開します。
- Notepad や別のテキスト エディタで entities.xml ファイルを開きます。
- 古い Confluence リンクを検索し、(新しい環境に合わせた) 新しいもので置き換えます。置き換えのオプションは「ベース URL の変更後にすべてのハードコードされたリンクを置き換える方法」をご確認ください。
- 弊社のドキュメントに従ってデータを Jira に復元します。「データの復元」
オプション 2: Jira データベースから直接編集
Confluence
Confluence の中~大規模のインスタンスでは XML バックアップのソリューションが最適ではない場合があるため、Confluence の XML バックアップの編集によるリンクの置き換えは非推奨です。代わりにデータベースでリンクを一括編集し、古い Jira のリンクを新しいもの (新しい環境に合わせる) に置き換えることをおすすめします。Confluence 側でこの問題を解決するための方法を「異なる Jira インスタンスをポイントするために Jira 課題マクロを一括で更新する方法」でご確認いただけます。