Sort results (order_by)

Sorts the entities returned from the server during a GET operation on collections.

The order_by parameter has the following syntax:

order_by=[<direction>]<field name>[[,[<direction>]<field name>]]

Example: /defects?order_by=severity,-creation_time

  • Field names are separated by commas (,).

  • If no order_by parameter is sent, the collection is sorted by entity ID.

  • Sorting is case-insensitive. This means that the values A B C D E a b c d e are sorted like this: A a B b C c D d E e .

  • Results can be sorted by any fields of the entity.

  • If no order_by parameter is sent, the collection is sorted by entity ID.

Example: Get the defects collection, ordered by name ascending and story points descending:

GET .../api/shared_spaces/<shared_space_id>/workspaces/<workspace_id>/defects?order_by=name,-story_points

See also: