Uploaded image for project: 'SR for Jira - Development'
  1. SR for Jira - Development
  2. SRJIRA-4892

Script Field does not sort properly in Issue Navigator

    Details

    • Type: Bug
    • Status: Triage
    • Priority: Low
    • Resolution: Unresolved
    • Affects Version/s: 6.13.1
    • Fix Version/s: None
    • Component/s: Scripted Fields
    • Labels:
      None
    • Critical Points:
      3.9

      Description

      Summary

      When the Search Template for a Script Field that displays number is set to 'Number Searcher', the field doesn't sort properly in the Issue Navigator. When the Search Template is set to 'None', it gets sorted correctly.

      Steps to Reproduce the Problem

       If you don't have a sample project yet, create a new one and create a number of test issues.

      1. gg > input 'Script Fields' > enter
      2. Click on 'Create Script Field' > choose 'Custom Script Field'
      3. Fill in the Field Name e.g. "Subtask Number" > set the 'Template' to 'Number Field'
      4. Place this sample script in the inline editor 
        return issue.subTaskObjects.size() as Double
      1. Click on 'Add' to save
      2. Configure Screens > select applicable screens for your project > click on 'Update'
      3. gg > input 'Custom fields' > enter
      4. Look for 'Subtask Number' > Actions > Edit > set the 'Search Template' to 'Number Searcher' > Update
      5. Click on 'Issues' tab on the top menu bar > 'Search for issues'
      6. On the Issue Navigator screen, set the view to 'List View'. Switch to Advanced search.
      7. Click on 'Columns' > input "Subtask Number" and check the box > click 'Done'
      8. On each of the created test issues, create a number of subtasks. You'll see a list of issues with random number of subtasks at the end of this step.
      9. Click on the 'Subtask Number' column to sort in ascending and descending order. Note that the numbers do not sort correctly.

      Note: When you're searching the issues with a much more specific query i.e. project = projectname AND type != Sub-task ORDER BY cf[xxxxx] ASC/DESC as opposed to just searching by ORDER BY cf[xxxxx] ASC/DESC, the script field can sometimes appear to be sorted correctly. In this situation, create a new test issue and sort again. It might sort correctly or otherwise - the sorting behaviour is observed to be inconsistent.

      Expected Behaviour

      Script Field should sort correctly in the Issue Navigator with 'Search Template' set.

      Actual Behaviour

      Script Field doesn't sort correctly in the Issue Navigator when the 'Search Template' is set with a custom field searcher e.g. 'Number Searcher'.

      Workaround

      Set the 'Search Template' for the Script Field to 'None'.

      This would render the Script Field unsearchable but sortable.

      Additional Info

      • In screen recording Screen Recording 2020-11-29 SRJSUP-16913.mov, the sorting for 'Subtask Number' script field doesn't work in ascending order while it appears to be working in descending order.
      • However, in this screen recording Screen Recording 2020-11-25 Customer's Example.mov which mimics the customer's setup, the sorting for 'Anforderungstests' script field appears to work in ascending order but failed to work in descending order. It takes setting the Search Template to 'None' for the script field to sort correctly.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            wkoh Winnie Koh
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated: