Sort is not working in Rally lookback (LBAPI aka Lookback API) query
search cancel

Sort is not working in Rally lookback (LBAPI aka Lookback API) query

book

Article ID: 398105

calendar_today

Updated On:

Products

Rally SaaS

Issue/Introduction

We are utilizing a Rally lookback query to retrieve audit records related to feature state changes. The response we received was unsorted, prompting us to apply the sort filter in the query to organize the results. However, the sorting function is not effectively ordering the response. Below, provide are the details of the query and the corresponding response.

Query:

https://rally1.rallydev.com/analytics/v2.0/service/rally/workspace/<WorkspaceOID>/artifact/snapshot/query.js?find={"ObjectID":<ObjectID>},_PreviousValues.ScheduleState%22:{%22$exists%22:true}}&fields=["ScheduleState","_SnapshotDate","_SnapshotNumber"]&hydrate=["ScheduleState"]&sort="_SnapshotNumber"&compress=true

Resolution

This is working as designed.  

The "SnapshotDate" field is not indexed in LBAPI and thus not sortable.  Please try using _ValidFrom instead.  The list of indexed fields is in the help doc: https://rally1.rallydev.com/analytics/doc#indices 

We have updated our response to include a Warning message: Sorting on unindexed fields is not supported.