Problem of duplicates in the issue view
Symptoms
After editing an issue and selecting a value in the Connect field, the selected value is displayed several times in the issue view, as shown on the following screenshot:
Example
Let's take the example of a MySQL database containing the following table:
user | ||
---|---|---|
user_id | user_firstname | user_lastname |
1 | Simon | Laffont |
2 | Napoléon | Bonaparte |
3 | Gengis | Khan |
4 | Frédéric | Barberousse |
5 | Simon | Dujardin |
Let's say we only want to display the user firstname. So here is the configuration of the Connect field that has been set up:
Cause
The problem of duplicates occurs because the key chosen in the Connect field is not unique.
In our example, the user firstname is defined as the Connect field key:
As we can see, the user_firstname column is not unique because it contains several times the same value: "Simon"
Resolution
The Connect field key must be absolutely unique. It's therefore necessary to use another column which will be used as the key.
Taking back our example, the user_id column is the most appropriate column to be the key:
Once the modification is made, the problem of duplicates is solved.