Using the Rally REST API, how can I get the non-API (website) URL for a user story?

▼魔方 西西 提交于 2019-12-09 17:44:09

问题


I'm using the Rally REST API to integrate user story data from Rally into another application. I have no trouble retrieving the user story data from Rally, however, I would like to provide a hyperlink for the users of the other application to click on to go to that user story within the Rally GUI (not using any API's).

For example, the URL for a user story using the REST API is something like:

https://www.rallydev.com/slm/webservice/1.30/hierarchicalrequirement/{ID}

whereas the URL that a user would use to view that story within Rally is something like:

https://www.rallydev.com/#/{ProjectID}d/detail/userstory/{ID}

Is there a way to get the GUI URL of a user story (the URL that an end user of Rally would use) from the REST API?


回答1:


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...




回答2:


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}



来源:https://stackoverflow.com/questions/10538441/using-the-rally-rest-api-how-can-i-get-the-non-api-website-url-for-a-user-sto

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!