-
Type:
Bug
-
Resolution: Timed out
-
Priority:
Low
-
Component/s: Work Item - Search - Backend - JVIS
-
1
-
Severity 3 - Minor
Issue Summary
The JQL order-by clause that sorts by the number-of-comments custom field produces wrong order,
Steps to Reproduce
- Create the Custom Field of the type "Number of Comments" and add this custom field to the appropiate screen to be able to use it in the JQL.
Example name of the custom field can be: "my_number_of_comments"
- Create couple of issues. Add some comments to the issues. Make some of the comments 'restricted to given group' and some of the comments normal ones.

- Go to JQL search and enter the JQL:
order by my-number-of-comments

4. Add "my-number-of-comments" column to the ouput list
5. Alternatively - use rest API JQL search to execute the search:
https://atl-vertigo--jira-jira-branch-mszymandera--5555.jira-dev.com/rest/api/3/search?jql=ORDER%20BY%20cf%5B10031%5D%20asc&fields=customfield_10031
Expected Results
The list is sorted by "my-number-of-comments"
Actual Results
The list is not sorted by "my-number-of-comments"

rest api actual results:
{"expand":"schema,names","startAt":0,"maxResults":50,"total":8,"issues":[ {"expand":"id":"10001","key":"ACC-1","fields":{"customfield_10031":"0.0"}}, {"expand":"id":"10005","key":"REW-5","fields":{"customfield_10031":"1.0"}}, {"expand":"id":"10002","key":"REW-2","fields":{"customfield_10031":"1.0"}}, {"expand":"id":"10004","key":"REW-4","fields":{"customfield_10031":"2.0"}}, {"expand":"id":"10006","key":"ACC-2","fields":{"customfield_10031":"6.0"}}, {"expand":"id":"10003","key":"REW-3","fields":{"customfield_10031":"3.0"}}, {"expand":"id":"10007","key":"ACC-3","fields":{"customfield_10031":"3.0"}}, {"expand":"id":"10000","key":"REW-1","fields":{"customfield_10031":"4.0"}}]}
Workaround
Currently there is no known workaround for this behavior. A workaround will be added here when available