Bamboo jobs history

Hi,

I want to create a report on the history of a specific job (passed vs failed) - not a plan.

Specifically, I want to know what percentage of the time a build job passes. I can get this at the plan (a plan has a build and test job) but I can't seem to get it at the job level.

Is that possible with Bamboo or Bamboo CLI? Even if can get the list of buids for a given job, I can write a script to parse and create the report myself, but I can't seem to get the list of builds for a given job...

2 answers

1 accepted

/rest/api/latest/result/PROJECT-PLAN-JOB

Won't this give me the result of only the latest run?

It gave me the entire history, why don't you try it.

Oh you are right; it did give me the latest 25 results...

I know I can do ?expand=results[25:100].results and get results for 25-100, but any chance you know how to get those results in .json format?

Doing

/rest/api/latest/result/ROBHEAD-LIN32-JOB1.json?expand=results[25:100].result

Does not give it to me in JSON format... what am I doing wrong? (neither does putting the .json at the end of .result)... [And I'm new to REST, so sorry if this is a beginners question]

/rest/api/latest/result/ROBHEAD-LIN32-JOB1.json?start-index=25&max-result=76

Indices start at 0, by default Bamboo will only return 25 results so above is the typical way to get a later subset. If you're more comfortable with your format you can still use it like this:

/rest/api/latest/result/ROBHEAD-LIN32-JOB1.json?max-result=0&expand=results[25:100].result

The main side effect I see is the size attribute goes from the result count to the entire set count.

I ended up modifying the the first route of:

/rest/api/latest/result/ROBHEAD-LIN32-JOB1.json?start-index=startIndex&max-result=10

and having a start Index that increases by 10 in each iteration of the loop.

Won't that give me just the result of the latest run?

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,489 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you