How to rank artifacts using Web Services API

Document ID : KB000057511
Last Modified Date : 14/02/2018
Show Technical Document Details

Issue

Is it possible to rank artifacts outside of the UI, using Web Services API?

Resolution

Web Services API documentation in the PUT/POST Parameters section mentions the following parameters that have effect for PUT and POST requests:


Set the value to an object reference url to cause the created/modified object to be ranked in relation to the referenced object.
Example: rankAbove=/slm/webservice/v2.0/defect/<Defect ObjectID>
Example: rankBelow=/slm/webservice/v2.0/defect/<Defect ObjectID>


NOTE: direct setting of alpha-numeric DragAndDrop rank is not supported and does not produce expected results. Only rankAbove and rankBelow endpoints are supported.

Below is an example of ranking one story above the other using curl command in the terminal.

Here is a screenshot showing the order of US2917 and US2916 prior to issuing the command:

User-added image

The stories re-ranked in this example have the following URLs:

US2917: https://rally1.rallydev.com/#/12352608219/detail/userstory/23528239683
US2916: https://rally1.rallydev.com/#/12352608219/detail/userstory/23528239390

Below is the cURL command, where _abc123 is an ApiKey of the user whose credentials are used to edit the stories:

curl --header "zsessionid:_abc123" -H "Content-Type: application/json" -d"{\"HierarchicalRequirement\":{}}" https://rally1.rallydev.com/slm/webservice/v2.0/HierarchicalRequirement/23528239390?rankAbove=/HierarchicalRequirement/23528239683

Notice the payload: {"HierarchicalRequirement":{}}"

Here is a screenshot showing the order of US2917 and US2916 after issuing the command:
User-added image