Details
-
Bug
-
Status: Done
-
Low
-
Resolution: Rejected
-
6.13.1
-
None
-
None
-
SR4J Sprint 107, SR4J Sprint 108, SR4J Sprint 109
-
7
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.
- gg > input 'Script Fields' > enter
- Click on 'Create Script Field' > choose 'Custom Script Field'
- Fill in the Field Name e.g. "Subtask Number" > set the 'Template' to 'Number Field'
- Place this sample script in the inline editor
return issue.subTaskObjects.size() as Double
- Click on 'Add' to save
- Configure Screens > select applicable screens for your project > click on 'Update'
- gg > input 'Custom fields' > enter
- Look for 'Subtask Number' > Actions > Edit > set the 'Search Template' to 'Number Searcher' > Update
- Click on 'Issues' tab on the top menu bar > 'Search for issues'
- On the Issue Navigator screen, set the view to 'List View'. Switch to Advanced search.
- Click on 'Columns' > input "Subtask Number" and check the box > click 'Done'
- 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.
- 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.