Rally Software

  • 1.  Roll up parent hierarchy for portfolio item

    Posted Jun 11, 2018 06:23 AM

    Hi All,

    I want the parent structure for a portfolio using API. Is anything existing? 

    Looking something like Parent1ID/Parent2id/.../Parent5id/Portfolioid

     

    I don't want to loop for each parent to get the parentid as it will hit performance issue.

     

    Thanks in advance,

    Sarada.



  • 2.  Re: Roll up parent hierarchy for portfolio item
    Best Answer

    Posted Jun 11, 2018 07:46 AM

    Sarada,

     

    There is not a way to do this without looping.  You will either need to walk the hierarchy up from the leaf Portfolio Items.  Or work down from the top by fetching the Children collections of the Portfolio Items.

     

    To help some, you may set the fetch parameter to be only what you need so you are not returning the whole Artifact for example:

     

    fetch=FormattedID,Name,Parent

     

    Michael



  • 3.  Re: Roll up parent hierarchy for portfolio item

    Broadcom Employee
    Posted Jun 11, 2018 06:41 PM

    Hi Sarada,

     

    Michael is correct. There isn't a way to do this without "looping".

     

    It's not exactly a loop but it's a recursive call. You will need to find the parent's parent, then the parent of that parent etc..

    The reason is that the information of the entire ancestry path is not stored on any given object. It needs to be constructed using this type of recursive call.

     

    Thanks,

    Sagi