Gadget on Dashboards are shown twice (duplicated) after upgrade to 9.x
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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
After upgrade to 9.x on every dashboard each gadget appears twice. Issue happens with all browsers, but a refresh of the browser cache (Ctrl + F5/Ctrl + R) clears the issue temporarily.
When moving to a different dashboard, or coming back to the dashboard from any other page, this issue happens again
Environment
Any Jira upgraded from 8.x
Cause
The following code (or similar) can be found in the announcement banner:
<script>
// Workaround for JRASERVER-73196
jQuery(function() {
setTimeout(function() {
const dashboardEl = document.getElementsByTagName('dashboard')[0];
if (dashboardEl && document.getElementById('dashboard').classList.contains('initializing')) {
AG.DashboardManager.setup({
layouts: JSON.parse(dashboardEl.getAttribute('layouts')).layouts,
params: JSON.parse(dashboardEl.getAttribute('params'))
});
console.log("Workaround for JRASERVER-73196 in announcement banner is done");
}
}, 100);
});
</script>
Which was a workaround published for and under JRASERVER-73196 - Jira Dashboard gadgets fail to load on Chrome 97/98/99 when caching is enabled in browser.
Solution
As the bug has been fixed in Jira 9.x the workaround needs to be removed from the announcement banner. See Configuring an announcement banner on how to edit the banner.