How to display placeholder text for custom fields in Jira
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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.
*Except Fisheye and Crucible
Summary
The content on this page includes steps to customize or extend Atlassian software (adding/changing CSS rules, HTML, JavaScript, etc.). Per the Atlassian Support Offerings, support does not include customizations made to Atlassian products. Be aware that this material is provided for your information only and using it is done so at your risk.
If you have any questions about this or any customization, please ask the community at Atlassian Community or consider working with an Atlassian Solution Partner.
This how-to provides a workaround to input placeholder texts into custom fields in Jira, while the issue below isn't published:
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.
Environment
Jira Core 7.x and 8.x.
Solution
The solution consists of editing the custom field's description to add a javascript code.
In the Custom fields admin section, edit the desired custom field
Take note of the ID in the browser URL, for example:
1
.../secure/admin/EditCustomField!default.jspa?id=10222
Go into the desired Project configuration page and click on the Field Configuration Scheme
For each Field Configuration in use, open it and search for the desired field
Click on Edit and add the following code to the field's description, replacing the custom field id and text accordingly:
1 2 3
<script> document.getElementById("customfield_10222").placeholder = "Type text here..."; </script>
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.
Was this helpful?