Generate a List for a date range using the BF Java API
Hi,
I am a builder, not a Java developer, so please forgive this simple question. Using the Build Forge Java API, what is the best way to generate a List<Build> where the members of that list fall between a startDate and an endDate? I know I can use the BF Java API to get a list of all projects like this: And for each Project returned, I can then ask for a list of all its Builds in a foreach loop:List<Project> projList = Project.findAll(conn); I also know the Build object supports a findBetween() method, but I think that would necessitate a second List<Build> using the findBetween() method to interrogate the first List<Build>.List<Build> buildList = proj.getBuilds(); Is there a better way to generate a list of Build Forge Builds that fall between a Date range? |
Accepted answer
Is the goal to list every build that was running around a specific time window, or to further filter/sort the results to by the build's parent project?
The Build method findBetween() should be sufficient to gather all the builds between a certain time window. But to filter the resulted list, you would need to generate the List of Projects to make the comparison to. Otherwise, if you are attempting to use one of the list generated "on-the-fly" to compared to the other created list object, this may be considered inefficient. As you would be calling Build Forge for the on-the-fly List object (whether it be Project or Build) to perform the comparison, instead of generating a variable to cache the data first. Randall Beck selected this answer as the correct answer
Comments
Randall Beck
commented Oct 09 '15, 2:59 p.m.
Hi Josh,
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.