Details
-
Suggestion
-
Resolution: Unresolved
-
None
-
None
-
0
-
Description
NOTE: This suggestion is for JIRA Server. Using JIRA Cloud? See the corresponding suggestion.
I have a chrome extension automatically detecting duplicate IDs in websites I visit. I was surprised that JIRA has some. I guess they are only problems if they cause problems. So I'm marking this as a suggestion.
Places where I see non-unique IDs include (for me):
Location | Non-unique IDs (pipe-deliminited) |
https://jira.atlassian.com/browse/GHS-12045 | bonfire_gettingstarted_link|addcomment|commentLevel-multi-select|commentLevel-suggestions |
https://byuced.jira.com/secure/Dashboard.jspa?selectPageId=14871 (a custom dashboard I use) | undefined |
https://byuced.jira.com/issues/?filter=-1 (viewing a filter) | tempo-bar-mlink|toggle-vote-issue|toggle-watch-issue|connector-issue-links|move-issue|assignee_tdryden|reporter_bean5 |
https://byuced.jira.com/secure/ManageRapidViews.jspa (view recently visited boards) | ghx-content-main|_bean5\ (_bean5 is a user id) |
https://byuced.jira.com/secure/ConfigurePortalPages!default.jspa (view list of dashboards) | enabled|tableId|entityType|entityId|relatedDropdown|removeId|titleAdd|titleRemove|undoText|undoEntityName|errorMsg |
https://byuced.jira.com/wiki/dashboard.action (View default confluence dashboard) | button-set |
View an agile board | tempo-bar-mlink|toggle-vote-issue|toggle-watch-issue|connector-issue-links|move-issue |
https://byuced.jira.com/secure/TempoUserBoard!timesheet.jspa (View Timesheets) | issuetable |
Note: Some ids are going to vary dynamically.
Following is the jQuery code used to detect duplicate IDs on page load. To detect them as they are created, you'd have to get more creative.
var duplicates = []; // Warning Duplicate IDs jQuery('[id]').each(function(){ var ids = jQuery('[id="'+this.id+'"]'); if( ids.length>1 && ids[0]==this && this.id !== '' &&//duplicates of empty ids aren't very important, I think this.id !== undefined ) duplicates.push(this.id); }); if(duplicates.length) console.warn(duplicates); if(duplicates.length > 0) { prompt('Some ids are not unique! This can lead to ambiguous code! You can copy the below regular expression to location infracting code.', duplicates.join('|')); }
Attachments
Issue Links
- relates to
-
JRACLOUD-43477 Remove non-unique IDs from JIRA
- Closed