Content
View differences
Updated by Ivan Kuchin over 1 year ago
Custom fields with format `list`, `user` and `version` allow multi-value select, though ordering is handled only for the multi-value list format, and is done differently then for single-value list format. While order of selection of items is stored, it is not explicit that the order is meaningful and interface doesn't allow moving items (when editing value for work package it is not possible to just change the order of values, it first needs to be set to a empty or different one).
For `user` and `version` ordering works, as if there was only first value. For `user` the order is by `lastname`, `firstname` then `id`. For version it is alphabetically by the name of the version (<mention class="mention" data-id="57550" data-type="work_package" data-text="#57550">#57550</mention>).
Also ordering for multi-value list format works different from single value format. Single-value orders projects/work packages by the position of selected item in the list, but multi-value orders by first sorting selected values by position in the list, then joining them using `.` and ordering alphabetically by resulting string. See example at the end.
Questions:
* [ ] Does ordering by multiple items, users, versions makes sense at all? ~~One option is to just remove ability to order by multi-value custom fields.~~ **Yes**
* [x] [ ] Should order of values be taken into account or should they be sorted before used for ordering? **No**
* [x] [ ] Should multi-value list items be ordered also by position and not alphabetically? **Yes**
* [x] Should we order users by `login` or `email` instead of `id`? This would simplify ordering logic, as it would allow ordering by list of strings and not list of strings mixed with integers. Is it accepted to use this information? **Use** `email`**.**
* [ ] There is already a separate ticket about sorting versions <mention class="mention" data-id="57550" data-type="work_package" data-text="#57550">#57550</mention>
So given following values in order for both custom fields:
<img class="image_resized op-uc-image op-uc-image_inline" style="width:143px;" src="/api/v3/attachments/185711/content">
Ordering by single select values does it according to that order:
<img class="image_resized op-uc-image op-uc-image_inline" style="width:139px;" src="/api/v3/attachments/185714/content">
But multi value makes it harder to understand (ordering is using "100", "100.20", "100.3", "100.3.20", "20", "3", "3.20"):
<img class="image_resized op-uc-image op-uc-image_inline" style="width:123px;" src="/api/v3/attachments/185716/content">
For `user` and `version` ordering works, as if there was only first value. For `user` the order is by `lastname`, `firstname` then `id`. For version it is alphabetically by the name of the version (<mention class="mention" data-id="57550" data-type="work_package" data-text="#57550">#57550</mention>).
Also ordering for multi-value list format works different from single value format. Single-value orders projects/work packages by the position of selected item in the list, but multi-value orders by first sorting selected values by position in the list, then joining them using `.` and ordering alphabetically by resulting string. See example at the end.
Questions:
* [ ] Does ordering by multiple items, users, versions makes sense at all? ~~One option is to just remove ability to order by multi-value custom fields.~~ **Yes**
* [x]
* [x]
* [x] Should we order users by `login` or `email` instead of `id`? This would simplify ordering logic, as it would allow ordering by list of strings and not list of strings mixed with integers. Is it accepted to use this information? **Use** `email`**.**
* [ ] There is already a separate ticket about sorting versions <mention class="mention" data-id="57550" data-type="work_package" data-text="#57550">#57550</mention>
So given following values in order for both custom fields:
<img class="image_resized op-uc-image op-uc-image_inline" style="width:143px;" src="/api/v3/attachments/185711/content">
Ordering by single select values does it according to that order:
<img class="image_resized op-uc-image op-uc-image_inline" style="width:139px;" src="/api/v3/attachments/185714/content">
But multi value makes it harder to understand (ordering is using "100", "100.20", "100.3", "100.3.20", "20", "3", "3.20"):
<img class="image_resized op-uc-image op-uc-image_inline" style="width:123px;" src="/api/v3/attachments/185716/content">