Rally Software

Expand all | Collapse all

how to replace a text string in multiple user stories

Anon Anon

Anon AnonOct 01, 2014 04:11 PM

  • 1.  how to replace a text string in multiple user stories

    Posted Oct 01, 2014 02:28 PM
    I need to replace a string which is common in multiple user stories. What is the best way to do that?


  • 2.  Re: how to replace a text string in multiple user stories

    Posted Oct 01, 2014 04:09 PM
    John, 

    Are you referring to a string in the description field? 


  • 3.  Re: how to replace a text string in multiple user stories

    Posted Oct 01, 2014 04:11 PM
    No, in the Name field.


  • 4.  Re: how to replace a text string in multiple user stories

    Posted Oct 01, 2014 05:26 PM
    John, thanks for that clarification.

    I guess either way, the best way to do this would probably be via one of the Rally REST API Toolkits, including:
    •           .NET
    •           Java
    •           Ruby
    •           Node.js
    The only way I can think of within the Rally UI is to filter your user stories list by that string, and do a bulk replace of the name. However, that is probably not what you want to do as the names are probably all different but just include that string.

    The best bet here is most likely going to be using one of the REST API toolkits above with a Replace() function per each toolkit's syntax.


  • 5.  Re: how to replace a text string in multiple user stories

    Posted Oct 01, 2014 05:44 PM
    In the UI, you could create a new custom view: 
    0EM140000004etH


    In the custom view's setting, you could specify a condition for Name contains "string": 
    0EM140000004etM

     Once you have created your view, you can go to Actions --> Multi Edit:
    0EM140000004etR


    From there, use the bulk edit feature at the top of the list to change the name of those stories:
    0EM140000004etW


    Hope that helps!


  • 6.  Re: how to replace a text string in multiple user stories

    Posted Oct 02, 2014 09:12 AM
    What I need to do is replace just that string within the full name string. Multi-Edit doesn’t seem to have a syntax for doing that.


  • 7.  Re: how to replace a text string in multiple user stories

    Posted Oct 02, 2014 05:26 PM
    Hi John,
    I have a javascript app example that queries user stories that satisfy this condition:
    (Name contains _oldString)
    and updates all returned stories' Name field by replacing _oldString with _newString. The rest of the name is not changed, only a part that matches the query.

    Please see the code in this github repo (https://github.com/nmusaelian-rally/replace-substring-in-names).

    It is outside of Rally support's scope to write or debug custom code. This app is written for illustration purposes of what is possible. Please see this article, "How to deploy a Rally Catalog or Custom app from HTML source" (https://rallydev.force.com/answers?id=kA014000000PKGy) on how to install this custom app in your workspace. You will have to modify the values of  variables _oldString and _newString currently in the code.

    WARNING: this app modifies your data. Before you run the app, I suggest testing the query on HierarchicalRequirement object  in the  WS API interactive document, e.g. (Name contains "my old string") and check the TotalResultCount and the results to make sure that the stories that the app will modify are actually the stories you want to be modified.
    I hope this helps.


  • 8.  Re: how to replace a text string in multiple user stories

    Posted Oct 03, 2014 09:43 AM
    I have insufficient privileges to open the Answers link below. What level do I need to request?


  • 9.  Re: how to replace a text string in multiple user stories

    Posted Oct 03, 2014 10:16 AM
    Hi John, sorry about that.  I just fixed that, please try that link again and let us know how it goes!


  • 10.  Re: how to replace a text string in multiple user stories

    Posted Oct 03, 2014 10:34 AM
    That helps. Just need one tiny bit of handholding. Do I need quotes around the old/new strings? That.”xyz” ?


  • 11.  Re: how to replace a text string in multiple user stories

    Posted Oct 03, 2014 11:21 AM
    Hi John, just single quotes on those variables, like this:
    launch: function() {
            this._oldString = 'publo';
            this._newString = 'van eyck';




  • 12.  Re: how to replace a text string in multiple user stories

    Posted Oct 03, 2014 12:08 PM
    Single quotes? The example had double quotes… Either way, how do I apply this app to a selected set of stories?


  • 13.  Re: how to replace a text string in multiple user stories

    Posted Oct 03, 2014 12:49 PM
    John, the code uses single quotes -- the code above was taken directly from the app.   This app will modify any user stories that contain the _oldString value specified, so there isn't a way to select stories for update other than that.  It's an unsupported app, so you may need to modify the code to get it to do exactly what you need it to do. 

    We also have Technical Services team that can be employed by customers to do custom app development work.  See article:  "How Technical Services can help you (https://rallydev.force.com/answers?id=kA014000000PK1j)".


  • 14.  Re: how to replace a text string in multiple user stories

    Posted Oct 03, 2014 01:15 PM
    OK, I think I will give up now for the changes I needed to make this week, but it’s good to know in case I want to pursue this in the future. Thanks!