Using the Rally REST API, how can I get the non-API (website) URL for a user story?
The ProjectID is actually optional, so you will get to the detail page with a link like this as well: https://rally1.rallydev.com/#/detail/userstory/12345
However this url format is not guaranteed not to change. In the new App SDK 2.0 we will make available some sort of versioned utility for building detail links for items to account for this...
If you do a GET such as:
https://rally1.rallydev.com/slm/webservice/1.30/hierarchicalrequirement/{ID}.js?fetch=Project,ObjectID
You'll get a result such as:
{"HierarchicalRequirement": {"_rallyAPIMajor": "1", "_rallyAPIMinor": "30", "_ref": "https://rally1.rallydev.com/slm/webservice/1.30/hierarchicalrequirement/<<STORYID>>.js", "_objectVersion": "129", "_refObjectName": "Story Name", "ObjectID": <<STORYID>>, "Project": {"_rallyAPIMajor": "1", "_rallyAPIMinor": "30", "_ref": "https://rally1.rallydev.com/slm/webservice/1.30/project/<<STORYID>>.js", "_objectVersion": "2", "_refObjectName": "Project Name", "ObjectID": <<PROJECTID>>, "_type": "Project"}, "Errors": [], "Warnings": []}}
You could then Pull the STORYID and PROJECTID off of the response. Then you can use the Project ObjectID from the response together with the Story ObjectID to stitch together your desired URL of:
https://rally1.rallydev.com/#/{ProjectID}d/detail/userstory/{ID}