-
Suggestion
-
Resolution: Unresolved
-
None
-
0
-
As an automation rule writer
I want the ability to sort a smart value list
So that I can access specific values from the list in my desired ordering
Acceptance criteria:
- add a new function, sort() to manage smart value list items
- accepts an attribute of the list to sort the list
- Example: {{{{{}issue.fixVersions.sort(name)}}}}
- accepts an optional parameter to control ascending or descending sorts, with a default value of ASC
- Example: {{{{{}issue.fixVersions.sort(name, "DESC")}}}}
- Bonus feature: multiple criteria can be specified for the sort order
- Example: {{{{{}issue.fixVersions.sort(releaseDate, "DESC", name, "ASC")}}}}
- Bonus feature: another smart value can be provided to describe the sort criteria
- Example:
- created variable of varSort = "name, 'DESC'"
- {{ {{issue.fixVersions.sort(varSort)}}}}
- Example:
Business case:
Using the min() and max() functions, it is possible to capture a specific value from a list (such as by dates), and then use that in a created variable with list filtering to extract a desired list value(s). However I do not believe there is a way to return the entire list in a desired order. A sort() function could simplify rules which need to identify all attributes of a smart value list item, given the first, last, etc. conditions for a particular sort ordering.