Fetch Build Statistics for an Application from Bamboo REST API
Asked Answered
H

1

9

I am looking for the Bamboo REST API which give us all recent Build Activity of an Application within a time-frame like all build of Last_7_Days, Last_1_Day, Last_30_Days etc. Similar to the report we get in Bamboo UI for Build Activity of a Plan. In Bamboo Report we have three section Chart, Data Table and Builds. We have REST API for Chart. But I still couldn't found any REST API to get the Build Activity. Report format attached for reference. enter image description here

I tried Bamboo Chart API but its giving output as a chart image. Does anyone know any Bamboo REST API to fetch Build Activity of an Application?

I will appreciate your help. Thanks

Hutch answered 20/9, 2016 at 9:10 Comment(0)
M
6

As you have found there are no direct REST APIs for build activity by time period.

I'd use the build REST API (https://developer.atlassian.com/bamboodev/rest-apis/bamboo-rest-resources#BambooRESTResources-BuildService%E2%80%94AllBuilds) and XLST to filter the results by time period.

Mellette answered 10/10, 2016 at 8:4 Comment(4)
Thanks for your response. I couldn't understand XLST to filter the results by time period? can you please explain bit more.Hutch
XLST can be used to transform/filter XML (en.wikipedia.org/wiki/XSLT). Here is an example for filtering the given XML on the left to show only those priced above $10 - w3schools.com/xsl/…Mellette
In the example above it applies the filter: <xsl:if test="price>10">. You could apply the same idea for your date rangesMellette
Thanks for the explanation :) That's is I am already doing with help of python script. I am getting API output in Json format and while iterating over json. I am comparing buildStartedTime with date range.Hutch

© 2022 - 2024 — McMap. All rights reserved.