Symptoms
Sorting and filtering of worklist items using K2 API does not work as expected. If the sorting option indicated is descending and this is being called first before the filtering criteria, the worklist items are being filtered then sorted.
eg. Worklist items arranged by descending order:
5, 4, 3, 2, 1
Case 1: Get All Items in Descending Order (by StartDate)
5, 4, 3, 2, 1
Case 2: Start Row = 1, Max Rows = 3
3, 2, 1 (Expected: 5, 4, 3)
Case 3: Start Row = 2, Max Rows = 4
5, 4, 3, 2 (Expected: 4, 3, 2, 1)
Diagnoses
Switching the calls for AddSortField() and AddFilterField() shows the same behaviour.
Tested for Ascending order and it works as expected
Resolution
This has been identified as a bug. Which version, if any, this will be addressed in has not been determined at this time. Product Management makes these decisions based on criticality, customer demand, and other factors.