How to display placeholder text for custom fields in Jira

お困りですか?

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

コミュニティに質問

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

    
 

本ページの内容には、Atlassian ソフトウェアのカスタマイズや拡張 (CSS ルール、HTML、JavaScript の追加/変更など) を行う手順が含まれています。アトラシアン サポートの提供 の通り、Atlassia 製品に加えられたカスタマイズはサポートされません。この資料は情報提供のみを目的として提供されています。内容はお客様自身の責任でご利用ください。

本件またはカスタマイズに関するご質問は、コミュニティの Atlassian Answers で質問してください。または、アトラシアン ソリューション パートナー にご相談いただくことをご検討ください。

要約

This how-to provides a workaround to input placeholder texts into custom fields in Jira, while the issue below isn't published:

JRASERVER-41418 - 課題詳細を取得中... ステータス

The description and other system fields don't allow placeholders, but you may pre-fill them with default values following through this article on How to add a default value to the Description field in Jira.

The solution presented here should work for the three operations: issue creation, issue edition and inline edition (editing from the view screen).

Be sure to read through the disclaimers and caveats of How to customize Jira with JavaScript and CSS, as this is such a customization.


環境

Jira Core 7.x and 8.x.


ソリューション

The solution consists of editing the custom field's description to add a javascript code.

  1. In the Custom fields admin section, edit the desired custom field
  2. Take note of the ID in the browser URL, for example:

    .../secure/admin/EditCustomField!default.jspa?id=10222
  3. Go into the desired Project configuration page and click on the Field Configuration Scheme
  4. For each Field Configuration in use, open it and search for the desired field
  5. Click on Edit  and add the following code to the field's description, replacing the custom field id and text accordingly:

    <script>
    document.getElementById("customfield_10222").placeholder = "Type text here...";
    </script>
  6. Update and reload the issue's page.


Keep in mind such customizations are ad-hoc and may impact usability or conflict with 3rd party apps.

We advise removing such scripts from field descriptions should you observe any unexpected behavior on issue screens, gadgets, filter results or Roadmap Plans.



最終更新日 2023 年 8 月 8 日

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

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