Details
-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
6.3.15, 6.4.7
-
6.03
-
1
-
Severity 3 - Minor
-
1
-
Description
Summary
When binding JIRA.Events.NEW_CONTENT_ADDED to JIRA issues (eg: via a webpanel), the event will be triggered twice when an issue is refreshed. This is confirmed by adding a console logging to the script:
Steps to Reproduce
- Create a test plugin, containing a web resource containing a javascript which is attached to the issue view:
<web-resource key="components-mod-resources" name="components-mod Web Resources"> <dependency>com.atlassian.auiplugin:ajs</dependency> <resource type="download" name="test-script.js" location="/js/test-script.js"/> <context>jira.view.issue</context> </web-resource>
AJS.$(function() { JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function(e, context, reason) { if (AJS.$('#my-test-element').length != 0) { if (reason == JIRA.CONTENT_ADDED_REASON.pageLoad) { console.log("Page Load"); } else if (reason == JIRA.CONTENT_ADDED_REASON.panelRefreshed) { console.log("Panel Refreshed"); } } }); });
- Once the plugin has been installed on a JIRA instance, access a test issue with the browser console opened.
- After the issue is loaded, refresh the issue for the first time by clicking on the issue key on the issue view:
- After the issue is refreshed, click on the issue key again and the event will be triggered twice:
Expected Results
The JIRA.Events.NEW_CONTENT_ADDED should be triggered once for each time an issue is refreshed.
Actual Results
The JIRA.Events.NEW_CONTENT_ADDED will be triggered twice when an issue is refreshed more than once.
Notes
This behaviour is also reproducible on the Issue Navigator with 'Detail View' enabled, when selecting between issues on the list.
Tested on JIRA 6.3.15.
Attachments
Issue Links
- is caused by
-
JRASERVER-28915 Investigate possible double firing of NEW_CONTENT_ADDED events
- Closed