Activity tab does not loads after opening an issue in Jira

Still need help?

The Atlassian Community is here for you.

Ask the community

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

The activity tab in Jira may not load initially for issues. 

Environment

Jira Data Center 9.x

Diagnosis

When opening an issue:

  • Activity tab does not loads
  • When clicking on issue link, it starts working
  • Multiple refreshes does not helps
  • Opening issue in new tab does not helps
  • HAR would show all responses as fine
  • Safe mode does not helps

A similar issue was identified in earlier version of Jira 9.x (before v9.4) and was fixed against:

JRASERVER-74303 - Getting issue details... STATUS

However, there are reports of problem in the version above fixed versions

Workaround

We do have couple of workarounds as below:

Workaround 1

Disabling the Lazy load via Dark Feature

  • Refer to How to manage dark features in Jira and disable this feature
  • Feature flag name: com.atlassian.jira.lazyload.activity.tabs
    • Navigate to <BASE_URL>/secure/admin/SiteDarkFeatures!default.jspa
    • Enter com.atlassian.jira.lazyload.activity.tabs.disabled in the Enable dark feature section.
    • Click on Add.

Workaround 2

Add the following HTML snippet script in the announcement banner

Script
<!-- BEGIN [JRASERVER-74303] -->
<script>
(function() {
    resourcePhaseCheckpoint.defer.then(() => {
        try {
            const Events = require('jira/util/events');
            const jQuery = require('jquery');

            console.log('__ [JRASERVER-74303] applying fixes...');

            // 1st part: isolating $onReady handlers
            try {
                const original = jQuery.fn.ready;
                jQuery.fn.ready = function (fn) {
                    try {
                        return original.call(this, fn);
                    } catch (e) {
                        console.error('__ [JRASERVER-74303] An error occurred in one of the jQuery onReady callbacks', e);
                        return this;
                    }
                };
            } catch (e) {
                console.warn('__ [JRASERVER-74303] could not isolate $onReady handlers', e);
            }

            // 2nd part: isolating JiraEvents handlers
            try {
                function isolateCallback(fn) {
                    return typeof fn === 'function' ? function isolatedCallback(...args) {
                        try {
                            return fn.apply(this, args);
                        } catch (e) {
                            console.error('__ [JRASERVER-74303] An error occurred in one of the JiraEvents callbacks', e);
                        }
                    } : fn;
                }

                (function(originalBind) {
                    Events.bind = function bindWithIsolatedCallbacks(types, fnOrEventData, fnOrFalse) {
                        originalBind(types, isolateCallback(fnOrEventData), isolateCallback(fnOrFalse));
                    };
                })(Events.bind);

                (function(originalBind) {
                    Events.one = function bindWithIsolatedCallbacks(evt, handler) {
                        originalBind(evt, isolateCallback(handler));
                    };
                })(Events.one);

            } catch (e) {
                console.warn('__ [JRASERVER-74303] could not isolate JiraEvents handlers', e);
            }
        } catch (e) {
        }
    });
})();
</script>
<script type="module">
    require([], function() {
        resourcePhaseCheckpoint.defer.then(() => setTimeout(() => {
            try {
                const Reasons = require('jira/util/events/reasons');
                const Types = require('jira/util/events/types');
                const Events = require('jira/util/events');
                const jQuery = require('jquery');

                // 3rd part: re-initialising activity tabs
                try {
                    const module = jQuery('#activitymodule');
                    if (module.length && !module.data('is-ready')) {
                        // it should already be marked as ready at this point
                        console.log('__ [JRASERVER-74303] re-initialising activity tabs ...');
                        Events.trigger(Types.NEW_CONTENT_ADDED, [module, Reasons.panelRefreshed]);
                    }
                } catch (e) {
                    if (module.data('is-ready')) {
                        console.warn('__ [JRASERVER-74303] Activity tabs should be init. now, but some other error occurred', e);
                    } else {
                        console.error('__ [JRASERVER-74303] could not re-init. Activity tabs', e);
                    }
                }
            } catch (e) {
            }
        }));
    });
</script>
<!-- END [JRASERVER-74303] --> 





Last modified on May 1, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.