Rally Software

  • 1.  API pull all Stories for Epic

    Posted Dec 11, 2018 10:14 AM

    I need to pull all the User Stories for specific Epic with API call.

    I am successfully pulling SubEpics, as it's only one parent:

     

    https://rally1.rallydev.com/slm/webservice/v2.0/portfolioitem/subepic?pagesize=2000&&start=1&query=(Parent.FormattedID = E101)

     

    And Less comfortable but still ok Features for the 5 SubEpics with OR statement.

    This isnt feasible for the US anymore As I have 170 Features.

     

    Is There a way to point the call for Features and User Stories straight at Epic?



  • 2.  Re: API pull all Stories for Epic
    Best Answer

    Broadcom Employee
    Posted Dec 11, 2018 10:44 AM

    Hi Dawid,

     

    Can you try these two for Features and Stories. Note the 'Parent.Parent. .. ' references up the chain to refer to the epic. Also note to use the correct endpoint, all I emphasized in bold

     

    https://rally1.rallydev.com/slm/webservice/v2.0/portfolioitem/feature?pagesize=2000&&start=1&query=(Parent.Parent.FormattedID = E101)

     

    https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement?pagesize=2000&&start=1&query=(Parent.Parent.Parent.FormattedID = E101)

     

    That works?

     

    Thanks,

    Sagi



  • 3.  Re: API pull all Stories for Epic

    Posted Dec 11, 2018 11:13 AM

    Hi Sagi

     

    Thank you for your help. It does work for the Feature level, thanks a lot!

     

    It doesn't however work at User Story level. I have tried with Parent.Parent.Parent.FormattedID = E101

    and also tried Parent.Parent.FormattedID = SE101

     

    https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement?pagesize=2000&&start=1&query=(Parent.Parent.FormattedID = SE101)

     

    https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement?project=https://rally1.rallydev.com/slm/webservice/v2.0/project/123456789&start=1&query=(Parent.Parent.FormattedID = SE101)

     

    https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement?pagesize=2000&&start=1&query=(Parent.Parent.Parent.FormattedID = E101)

     

    All three return nothing.



  • 4.  Re: API pull all Stories for Epic

    Broadcom Employee
    Posted Dec 11, 2018 11:21 AM

    Hi Dawid,

     

    Apologies. For the user story, can you try:

     

    https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement?pagesize=2000&&start=1&query=(Feature.Parent.Parent.FormattedID = E101)

     

    (note that instead of Parent.Parent.Parent, I'm using this time: Feature.Parent.Parent). The reason is that from the user story you refer to the feature by using the Feature field, then to the subepic by using Feature.Parent, and then to the epic by using Feature.Parent.Parent.

     

    Let us know if worked.

    Sagi



  • 5.  Re: API pull all Stories for Epic

    Posted Dec 11, 2018 11:33 AM

    Hi Sagi

     

    Unfortunately it didn't work... but this one did:

     

    https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement?project=https://rally1.rallydev.com/slm/webservice/v2.0/project/123456789&start=1&query=(Feature.Parent.FormattedID = SE101)

     

     

    Not ideal but acceptable as I have only 5 SubEpics under so can do the OR statement.

     

    Thank you for your help!