sorting by number-of-comments custom field in JQL gives wrong order

XMLWordPrintable

    • 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

      1. 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"
      1. 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.
      2. 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

       

       

       

        1. image-2021-10-07-16-07-35-017.png
          39 kB
          Michal Szymandera
        2. image-2021-10-07-16-10-42-890.png
          358 kB
          Michal Szymandera
        3. image-2021-10-07-16-20-55-391.png
          390 kB
          Michal Szymandera
        4. image-2021-10-07-16-25-56-784.png
          87 kB
          Michal Szymandera

            Assignee:
            Unassigned
            Reporter:
            Michal Szymandera
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: