How to update or change outgoing links from Jira issues and Dashboards

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: 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 は除く

    

This article was formerly titled "How to change the base URL in Jira", but renamed on Aug 12 2022 to fit a broader scope of any outgoing link.

要約

When changing Jira's base URL (something common when migrating environments) or refreshing a test environment with Production data, several places in Jira may contain links to URLs that we should change, too.

Not updating these links may result in users being redirected to the old Jira URL or being redirected back to Production Jira or other Production Apps while browsing Jira in the test environment.

Please note this article is constantly under improvement and may not address all possible scenarios yet.

Also note 3rd party apps may, too, contain links that should be updated but it's beyond the scope of this article to address all of them. You should reach out to each app vendor if you notice wrong links in them and on how to update them.


環境

Any version of Jira from 7.x onwards.

The DML commands on this article were written for the Postgres DB. You may need to tweak them to work on your specific DB.


ソリューション

The steps ahead presume Load Balancers, internal DNS and reverse proxies have already been configured for the new URL — as well as Jira Tomcat's server.xml under Jira's installation folder.

You may run the commands below for Jira's own URL if it's changed or to update other Apps' URLs (like from a Production Jira Align URL to the Test's URL).

1) Update Jira's base URL

When Jira's started on the new server and responding to the new URL, it'll pop up an alert when logging as Admin about the base URL not being set correctly.
You can either follow the link on the very alert popup or follow this guide on configuring the base URL. Just update it with the new URL and it's done.

Before the whole migration, it's prudent to access Jira's Application Links and take note of their configuration (which apps are connected and how: OAuth, OAuth with impersonation, etc).

After the migration is completed and Jira's accessible through the new URL, you may recreate the application links.

This should work two-way with Confluence and other Atlassian apps, so you shouldn't need to go through similar steps on all other Atlassian apps.


3) Change URL references in Gadgets and Issue


Text gadgets, issue descriptions, and issue comments can have text that mentions the previous Jira URL.

They should also be updated to prevent errors or misguidances when Jira is used.

データベースの変更を行う場合は必ず事前にバックアップを取得してください。可能な場合は、まずステージング サーバーで SQL コマンドの変更、挿入、更新、または削除を行うようにします。

Execute the following commands on Jira's DB to update these records:

Update text gadgets
update gadgetuserpreference set userprefvalue = REPLACE(userprefvalue, 'old-url.com', 'new-url.com') where userprefvalue like '%old-url.com%';
Update issues weblink
update remotelink set url = replace(url,'old-url.com','new-url.com') where url like '%old-url.com%';

update remotelink set iconurl = replace(iconurl,'old-url.com','new-url.com') where iconurl like '%old-url.com%';
Update issue descriptions
update jiraissue set description = REPLACE(description, 'old-url.com', 'new-url.com') where description like '%old-url.com%';
Update issue comments
update jiraaction set actionbody = REPLACE(actionbody, 'old-url.com', 'new-url.com') where actiontype = 'comment' and actionbody like '%old-url.com%';
Update single-line text custom fields
update customfieldvalue set stringvalue = REPLACE(stringvalue, 'old-url.com', 'new-url.com') where stringvalue like '%old-url.com%';
Update multi-line text custom fields
update customfieldvalue set textvalue = REPLACE(textvalue, 'old-url.com', 'new-url.com') where textvalue like '%old-url.com%';
Update Project side bar shortcuts
update "AO_550953_SHORTCUT" set "SHORTCUT_URL" = REPLACE("SHORTCUT_URL", 'old-url.com', 'new-url.com') where "SHORTCUT_URL" like '%old-url.com%';


In all of them, replace 'old-url.com' and 'new-url.com' accordingly.


Query Syntax

Please note that we've validated these queries with PostgreSQL. If you are using a different database system, you might need to review the query syntax and change it accordingly.



最終更新日 2022 年 8 月 19 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.