How to disable custom Configure Fields in Create Issue screen in Jira Server and Data Center
プラットフォームについて: 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 は除く
問題
During issue creation and issue edit, the "Configure Fields" button will be shown on the top right corner of the screen, as below:
Jira < 8.22 | Jira > 8.22 |
---|---|
Up to Jira 8.21.x the screen change occurs as the fields are checked or unchecked in show Custom Fields. | Starting in Jira 8.22.x the changes are only applied after clicking on Apply changes. |
However Jira administrators may want to prevent users to create a custom screen as although some fields may not be required (starred, so may cannot be changed), are important to be kept.
ソリューション
To block the changes users may enter in Configure Fields, a Javascript needs to be injected in a field or banner.
The script:
<!-- Message Banner -->
<div style="background-color: clear; border: 2px ; margin: 2px; padding: 2px; font-weight: bold; text-align: center;">
<font size="3"><b>Open a <a href="https://jira.availity.com/servicedesk/customer/portal/44/group/212" target="_blank">Jira Support Request</a> or <a href="https://jira.availity.com/servicedesk/customer/portal/44/group/223" target="_blank">Tempo Support Request</a></font></b>
</div>
<script type="text/javascript">
/* this script runs on every page in jira, used for customization via javascript */
// comment out the line below to show banner. Add content below /script tag
// $("#announcement-banner").hide();
function forceUIMod() {
// this will force all hidden fields to appear on "Create as Linked" screen
$(".qf-field").css("display","block");
// keep code light here, it runs often
}
setTimeout( function() { forceUIMod(); }, 500);
// try to run right away
setInterval( function() { forceUIMod(); }, 2000);
// respond to DOM changes
</script>
<!-- Content for announcement banner -->
<!-- End content -->
使用方法:
- Ensure your instance allows custom HTML or Javascript on Administration > System > General configuration > Edit Settings > "Enable HTML in field descriptions and list item values" ON
- Add the Javascript in a Custom field or Banner Edit information, below an example from banner:
- Go to Administration > System > Announcement banner and add the Script above
- Go to Administration > System > Announcement banner and add the Script above
- At this point the Configure Fields Custom Fields will not change the screen.
Note this is only visual, even though not showing in interface, in database the user modification is stored.
結果
The result can be seen as the short video below.
詳細情報
- Field behavior, including marking fields as required
- How to hide Configure the Configure Fields Button
- How to find User's "Configure Fields" custom settings using database query
- Fields Allowing Custom HTML or JavaScript
- How to identify fields with custom javascripts in their description in Jira