Rally Software

Expand all | Collapse all

Custom List: how to order query results

  • 1.  Custom List: how to order query results

    Posted 09-13-2016 01:37 PM
    I have seen vague references to ordering the query results in the Custom List using 'order' and 'desc' but have yet to find an example using these attributes nor have I successfully been able to find an implementation that works.  Can someone either point me to an example or provide one that I can leverage?  Thanks in advance for your help.

  • 2.  Re: Custom List: how to order query results

    Posted 09-14-2016 03:51 PM
    Hi Joe,

    As far as I know, there is no way to do this on a custom list.  However, depending what you are trying to do...

    If its stories, I have found you can go to PLAN | USER STORIES and build a custom view, it allows query and order.

    Another option would be to write a quick custom app.  The help file shows some pretty easy examples on basic grids, or if you are interested in this route mention it here and me and some others may be able to help out.

    Hope this helps.

  • 3.  Re: Custom List: how to order query results

    Posted 09-15-2016 09:44 AM
    Hey Joe,

    Thomas is right - there isn't a way to do this via a query on Custom List. You could do a custom app, or query the API directly via a URL like this: https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement?order=Name%20DESC&pretty=true

  • 4.  Re: Custom List: how to order query results

    Posted 09-30-2016 12:52 PM

    So I'm flummoxed here - having the same issue with vague references to ordering query results.  Why aren't there any listings for or examples of the Order syntax (is it order, Order, order by, sort.order, etc.)?  Are we just supposed to guess how to use it?  

    I'm referring the the help pages at https://help.rallydev.com/use-grid-app-queries and https://help.rallydev.com/grid-queries

    Would it be:
    Order = Rank.desc
    Order.desc = Rank
    sort.order = Rank.desc

    I want to update the My Tasks app I use on my Dashboard to correctly sort my tasks (currently it does not, they're just presented in some random order for some reason), so this is what I've tried but doesn't work.

    (((State != Completed) AND ((Owner = {user}) AND ((Iteration.StartDate <= today) AND (Iteration.EndDate >= today))))  Order = Rank.desc)

    I get no error message, so I have no idea what part, if any, is incorrect.

    Lastly, again - why is there no listing for order syntax????  Seems like such a huge miss because ordering/sorting items is next in importance after selecting your items....



  • 5.  RE: Re: Custom List: how to order query results

    Posted 08-16-2019 12:29 PM
    I found this post from 2016 while trying to figure out why my order by syntax isn't working.  I'm not sure if there has been a fix for it, but I don't see a resolution on this communication string.  Here is my syntax:  ((Iteration.StartDate >= "today-548") Order = Iteration.StartDate.desc)

    The Iteration start date filtering is working just fine, but the order clause is not working.  No errors at all, so it appears to just ignore the order clause.  Any ideas?

  • 6.  RE: Re: Custom List: how to order query results

    Posted 08-21-2019 11:00 AM
    Hey Cory did you ever find a solution to this? I am dealing with the same issue. My query below:

    Custom board to display Iteration tasks

    ((LastUpdateDate >= "today -60") Order = Task.LastUpdateDate.Desc)

    No error message, but the sorting clause is ignored.

  • 7.  RE: Re: Custom List: how to order query results

    Posted 08-21-2019 11:10 AM
    No, unfortunately I have not.

  • 8.  RE: Re: Custom List: how to order query results

    Posted 08-21-2019 11:20 AM
    Hi Cory,

    Can you direct me to the location where you found this syntax?  To the best of my knowledge, there isn't an available method to use order within a query statement.  It is a separate parameter passed to the API in the URL, which isn't possible through a Custom List.

    So the structure is as follows:

    There's more information here:https://rally1.rallydev.com/slm/doc/webservice/
    query The query string is query=(FormattedID%20%3D%20S40330) in the example below.
    Example: https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement?query=(FormattedID%20%3D%20S40330)
    order A sort string which determines the order of the data returned. desc will present the data in descending order.
    Example: order=Name desc