Rally Software

 View Only
  • 1.  Lookback API Efficiency - querying for n stories

    Posted Jul 10, 2018 12:40 PM

    Hi

     

    So I am tasked with running a query for a large list of n formatted ID strings. Below, I have outlined how I am currently running the query. I have noticed the query takes anywhere from 0.5-2 seconds per formatted ID.

     

    I am wondering if there is a faster method of querying for a large number n of strings.

    LookbackApi lookbackApi = new LookbackApi(); lookbackApi.setCredentials("myusername", "mypassword"); lookbackApi.setWorkspace("myworkspace");

    LookbackQuery query = lookbackApi.newSnapshotQuery();

    query.setPagesize(20000)
          .setStart(0)
          .requireFields("ScheduleState", "FormattedID", "_ValidFrom", "Blocked", "Project")
          .sortBy("_ValidFrom")
         .hydrateFields("ScheduleState", "Project");

    for(String formattedID : list) {
        query.addFindClause("FormattedID", formattedID);
        query.execute();
        // process the query results
    }

     

    Appreciate any info you can provide!



  • 2.  Re: Lookback API Efficiency - querying for n stories

    Posted Jul 10, 2018 12:52 PM

    Hey Ken - What product is this for? I'd like to get it to the right product community to make sure you get a response. Thanks.



  • 3.  Re: Lookback API Efficiency - querying for n stories

    Posted Jul 10, 2018 01:03 PM

    Hey JJ - The product is the Lookback API. We are using it to query Rally items



  • 4.  Re: Lookback API Efficiency - querying for n stories

    Broadcom Employee
    Posted Jul 10, 2018 05:32 PM

    Hi Ken,

     

    I see you are only adding one findClause for the FormattedID. I think what may happen here is that since it's not narrowed down then the product is searching/finding this FormattedID per all object types. 

     

    You may already have, but please see this page:

    Rally-Lookback-Toolkit/README.md at master · RallyTools/Rally-Lookback-Toolkit · GitHub 

     

    Check out this section:

     

    "Add query clauses with query.addFindClause(field, value). To query for Defects in a project, add two clauses to the query:

    query.addFindClause("_TypeHierarchy", "Defect"); query.addFindClause("Project", 1234); // replace 1234 with your project OID."

     

    Can you see if you can narrow down the scope of the search by adding more findClauses, perhaps for the project, perhaps for the TypeHierarchy type etc.. - basically to limit the search/find scope.

     

    I'm hoping this will make each iteration run faster.

     

    Please let us know if that helped.

    Sagi