How to bulk hide multiple custom fields in a field configuration

お困りですか?

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

コミュニティに質問


プラットフォームについて: Data Center のみ - この記事は、Data Center プラットフォームのアトラシアン製品にのみ適用されます。

この KB は Data Center バージョンの製品用に作成されています。Data Center 固有ではない機能の Data Center KB は、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。

*Fisheye および Crucible は除く

要約

There are scenarios where the Default Field Configuration has too many custom fields that need to be hidden.

Clicking the Hide button several times can be done on a few custom fields, but if there are hundreds or thousands of custom fields to hide, a viable option would be to do it using database queries instead.

Ultimately, the best way is still to avoid creating unnecessary or duplicate custom fields in the first place and to make sure to consult with teams before creating a new custom field to avoid this situation.

環境

Tested on Jira 8.13.

ソリューション

Hiding multiple custom fields in a field configuration can be done using direct database updates.

Changes to Field configurations from the database side will only show up on the UI after a restart of Jira.

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

本記事で説明している手順は、現時点でのものとなります。そのため、一部のお客様で特定の状況下で動作したという報告がありますが、正式にサポートされているわけではなく、お客様の特定のシナリオで動作することを保証するものではありません。

本番環境での実施の前に一通り非本番環境で検証し、成功しなかった場合にはサポートされている代替案にフォール バックしてください。

また、アトラシアン サポートのサポート対象外のご質問の場合には、Community もご活用ください。

  1. Find the ID of the fieldlayout you want to modify. Review the contents of this table to do so:

    select * from fieldlayout;
  2. You may follow up with this query to see what is available on this field layout:

    select * from fieldlayoutitem where fieldlayout in (<fieldlayoutid>);
  3. This query will hide necessary custom fields instead on the database. This query was tested on a PostgreSQL database for the field configuration with <fieldlayoutid>. You'll still need to have a pattern for the custom fields you want to hide or alternatively you may replace the last line below with fieldidentifier in ('fieldname1','fieldname2','fieldname3') .

    update fieldlayoutitem
    set ishidden = 'true'
    where fieldlayout = <fieldlayoutid>
    and fieldidentifier like '%customfield%';
    
  4. The change won't show up on the UI until a restart of Jira is done. However, the field configuration can be copied to a new field configuration. The new field configuration would have the custom fields hidden as a result.




最終更新日: 2021 年 12 月 1 日

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

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