A requirement came up recently that the user should be encouraged (forced) to search for a matching existing issue before submitting a new one. This particular group spent a lot of time “deduping”, and it turns out that around 80% of their issues were closed as duplicates.
The solution outlined below, does a search for possible duplicates after the summary field loses focus. The results of the search can either be displayed below the summary, or for a more in-your-face experience, in an overlay.
At this stage the user can click the possible dupes which will open the issues in a new tab. Then they either abandon or creating a new issue, or if none of them are a match they can proceed.
Overlays are not documented as yet but are in the latest version of the behaviours plugin. You simply build up a string of HTML to be shown in the overlay and call field.setOverlay(string). Although the setOverlay method is a member of FormField it’s not associated to any one field. Example:
To set this up I use a behaviour that contains a validator for the summary field, so, when the summary changes and the field loses focus, the search is done. If you wanted to include another field in the search, for instance the component, you would put the validator on that field, although you’d have to make it mandatory to ensure that the dupe search always happened.
Finally, this is experimental. Whether you get good results or not depends how many useful words are in the new issue summary relative to chaff words (although the common “stop” words are filtered out of the search and of the results highlighting).
Should you want to try this yourself here is the code.