Rally Software

Expand all | Collapse all

Given a User story ID (US123), how can I create an URL that links to this user story in my workspace?

Jump to Best Answer
  • 1.  Given a User story ID (US123), how can I create an URL that links to this user story in my workspace?

    Posted 08-27-2014 04:13 AM
    I'm editing some wiki pages on my company's internal wiki (MediaWiki), and I want to refer to a user story from there. It would be neat if I could create a template, instantiated by user story number, but all URLs I can find are based on some sort of object ID instead. It would be really nice to have a short-cut URLs, something like https://rally1.rallydev.com/#/12345678/detail/userstory/by-id/{{{1}}}, which I could use for my template. Is there a known way to achieve this?


  • 2.  Re: Given a User story ID (US123), how can I create an URL that links to this user story in my workspace?
    Best Answer

    Posted 08-27-2014 02:49 PM
    I am afraid there is no canned template URL like that one you suggested. But it can be built programmaticaly if you are writing a javascript/html code. For example in our AppSDK we constantly build those URLs. Of course there is syntactic sugar provided by some methods, e.g.getDetailUrl (https://help.rallydev.com/apps/2.0rc3/doc/#!/api/Rally.nav.Manager-method-getDetailUrl),  I used it in this app (https://github.com/nmusaelian-rally/salesforce-cases) where 'a href' HTML attribute is returned after the base url is concatenated with a variable value:
    return '<a href="'+ Rally.nav.Manager.getDetailUrl(value) +'" target="_blank">' + value.FormattedID +'</a>'
    but even if you do not use AppSDK as long as you can construct 'a href' attribute in your code programmatically a URL with a variable should work.


  • 3.  Re: Given a User story ID (US123), how can I create an URL that links to this user story in my workspace?

    Posted 08-28-2014 06:45 AM
    Thanks!

    I'm new to rally customizations/integrations, so I don't know where to start. I can imagine two different paths:
    1. let my wiki template produce an URL to a CGI script on my server, with the FormattedID as a parameter. The CGI script will then talk to rally servers, convert the FormattedID to the right rally URL, and produce a redirect page.
    2. Create some sort of webpage on a rally server, with functionality similar to (1) (i.e., with a URL parameterized by FormattedID). I know nothing about how to do these things, but one requirement is that the URLs would have to be accessible for all my teammates.

    Which option would be more feasible? I suppose the challenge with (1) would be to set up my webserver to get access to the Rally API, with permissions to access my workspace. The challenge with (2) is that I don't know in which end to start.

    Which approach would you suggest? And do you know any relevant tutorial or documentation on getting started with it?

    Thanks,
    Erik


  • 4.  Re: Given a User story ID (US123), how can I create an URL that links to this user story in my workspace?

    Posted 08-28-2014 12:52 PM
    I do not know what constraints wiki imposes on development. But if you can port an html file, the best path would be to write an html/javascript app using Rally AppSDK2rc3 which is based on Sencha's ExtJS framework.  The learning curve can be a little steep if one does not have experience with javascript.Creating a dynamic URL with AppSDK2rc3 as I mentioned in my first post is a very common thing to do.  Please start here (https://help.rallydev.com/apps/2.0rc3/doc/).
    Rally recommends developing and debugging apps externally first since it is faster than repeatedly copy/pasting code into a Rally Custom HTML Panel. When you build Rally apps using rally-app-builder (https://help.rallydev.com/apps/2.0rc3/doc/#!/guide/app_builder)App-debug.html is generated that you can load directly in the browser. There is no need to create a custom webpage on a "rally server" as you said. After you finish building the app using "build" command, your final App.html or App-uncompressed.html inside "deploy" folder will have a relative url to SDK:
    <script type="text/javascript" src="/apps/2.0rc3/sdk.js"></script>
    since the assumption is that user going to paste that code inside a custom app in Rally. But since your goal is to run the app externally in a wiki (however you embed it there is another question) you want to change that url to a full path:
    <script type="text/javascript" src="https://rally1.rallydev.com/apps/2.0rc3/sdk.js"></script>
    I assume that the js code you will write will include a dynamic URL to Rally artifacts that you may construct using Rally.nav.Manager (https://help.rallydev.com/apps/2.0rc3/doc/#!/api/Rally.nav.Manager) class.
    After your app is done and runs successfully outside of  Rally directly in the browser you will have to port it to your wiki system. Plesae note that running an app externally does not eliminate a need to authenticate. If a user is not currently login to Rally in another tab of the same browser window, when this user loads a Rally app externally a Rally authentication prompt will come up.
    There is a new feature called ApiKey (https://help.rallydev.com/rally-application-manager) that allows bypass the prompt, but it has to be used with caution. For example, it is recommended that the ApiKey is created for a specifically designated user that only has viewer rights. See "Embedding Apps" documentation here (https://help.rallydev.com/apps/2.0rc3/doc/#!/guide/embedding_apps).
    This does not mean that you have to use ApiKey. If it's ok that each user is prompted for Rally credentials when accessing your Rally custom app inside a wiki that is fine. The bottom line is that if you can embed an html inside wiki, then build a dynamic <a href> attribute that concatenates an id stored in a variable to a base url.


  • 5.  Re: Given a User story ID (US123), how can I create an URL that links to this user story in my workspace?

    Posted 11-21-2014 07:28 PM
    I found a better answer elsewhere, and it seems to work well:
    http://stackoverflow.com/questions/13712995/generate-a-url-to-rally-objects-using-formattedid