Find issue links with both remote link and local instance links for an issue from the database
プラットフォームについて: Data Center のみ。 - This article only applies to Atlassian apps on the Data Center プラットフォーム。
この KB は Data Center バージョンの製品用に作成されています。Data Center 固有ではない機能の Data Center KB は、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。 Server* 製品のサポートは 2024 年 2 月 15 日に終了しました。Server 製品を実行している場合は、 アトラシアン Server サポート終了 のお知らせにアクセスして、移行オプションを確認してください。
*Fisheye および Crucible は除く
要約
How to find issue links with both remote link and local instance links for an issue from the database.
環境
8.20.x
原因
At times, end users might miss certain issue links they believe should be linked to the issue they are viewing. There are rest endpoints to to get the Remote links and the local instance link separately. But not a single call to get both types of links together.
ソリューション
The following query can be utilized to gather all the issues and their related issues and their relation along with whether the relationship is local or remote link.
Postgres
with cte as (select ji.id as id, ji.project as project, ji.issuenum as issuenum, p.pkey as pkey from jiraissue ji join project p on p.id = ji.project)
select cte.id as id, cte.pkey || '-' || cte.issuenum as SrcIssueKey,Rl.Title as RelatedIssueKey,ilt.linkname as Relationship,'Remote' as Type from cte join remotelink rl on rl.issueid = cte.id join issuelinktype ilt on ilt.outward = rl.relationship
union
select cte.id as id, cte.pkey || '-' || cte.issuenum as SrcIssueKey,Dest.issuekey as RelatedIssueKey, ilt.linkname as Relationship,'Local' as Type from cte join issuelink il on il.source = cte.id join issuelinktype ilt on ilt.id = il.linktype join (select cte.pkey || '-' || cte.issuenum as issuekey, ill.linktype as linktyp, ill.source as sourceid from cte join issuelink ill on ill.destination = cte.id join issuelinktype ilt on ilt.id = ill.linktype) Dest on Dest.sourceid = il.source and Dest.linktyp = il.linktype
union
select cte.id as id, cte.pkey || '-' || cte.issuenum as SrcIssueKey,Source.issuekey as RelatedIssueKey, ilt.linkname as Relationship,'Local' as Type from cte join issuelink il on il.destination = cte.id join issuelinktype ilt on ilt.id = il.linktype join (select cte.pkey || '-' || cte.issuenum as issuekey, ill.linktype as linktyp, ill.source as sourceid from cte join issuelink ill on ill.source = cte.id join issuelinktype ilt on ilt.id = ill.linktype) Source on Source.sourceid = il.source and Source.linktyp = il.linktype
order by id;
この内容はお役に立ちましたか?