Rally Software

 View Only
  • 1.  Pagination while extracting data from Agile Central

    Posted Aug 09, 2017 10:43 AM

    how to set the pagination in the getrequest result while extracting data from Agile Central


    GetRequest req= new GetRequest(_ref);
    response = restApi.get(req);
    teamMemberObject= response.getObject();
    JsonArray array= teamMemberObject.getAsJsonArray("Result")
    for(i=0; i<array.size(); i++){
    //get Property value
    }
    while executing the above code we are getting IndexOutOfBounds Exception as the arry is only picking up 20 records be default not more than that. 

     

    Thank you for Help in Advance. 



  • 2.  Re: Pagination while extracting data from Agile Central
    Best Answer

    Posted Aug 10, 2017 02:56 AM

    Avi12Apr2017,

     

    The Web Services API Documentation provides information about the parameters available when using the WSAPI.  It is available at:

     

    https://eu1.rallydev.com/slm/doc/webservice/ 

     

    And for your specific question, these two sections apply:

     

    pagesizeNumber of results to display on the page. Must be greater than 0 and less than or equal to 200 for 1.x API calls or 2000 for 2.x API calls. The default is 20.
    Example: pagesize=30

     

    startThe start index for queries, which begins at 1. The default is 1.
    Example: start=1

     

    If you are not using the Toolkit available for Java, it can be a real help.  Although not officially supported, it is available here:

     

    GitHub - RallyTools/RallyRestToolkitForJava: A Java Toolkit for Accessing Rally's Webservice API 

     

    You can find all sorts of examples, questions and answers to common issues here:

     

    Newest 'rally java' Questions - Stack Overflow 

     

    There are also a couple of GitHub repositories that have all sorts of examples:

     

    GitHub - nmusaelian-rally/rally-java-rest-apps: allowedvalues 

     

    GitHub - markwilliams970/rally-java-rest-apps: attachment 

     

    Hope that helps.

     

    Michael