Focus is Switched to a Different Field
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
Symptoms
When viewing a page in JIRA, focus is switched to a field other than the desired field.
Cause
Unexpected JavaScript is running on the page. This is usually due to a third party plugin, JavaScript in the custom field description, or a customisation to one of the files.
Diagnosis
To see which code is running focus JavaScript, add this diagnostic script to the announcement banner:
1
2
3
4
5
6
7
8
9
10
11
<script type="text/javascript">
jQuery.fn["origfocus"] = jQuery.fn["focus"];
jQuery.fn["focus"] = function(fn){
if (fn) {
return jQuery.fn["origfocus"].apply(this,arguments);
} else {
alert("jQuery.fn.focus caller"+arguments.callee.caller);
return jQuery.fn["origfocus"].apply(this, arguments);
}
};
</script>
Also, refer to Administration >> System Info
to see which files have been modified.
Resolution
The diagnostic script should help identify the code that's executing focus. It may help to reinstall JIRA, to eliminate any local customisations.
Was this helpful?