I have a build status bot that monitors the statuses of various plans. I also want it to monitor the statuses of all the branches of all the plans. Once I had the plan_key and branch_name, I used to be able to do this with:
branch_info = bamboo.get_branch_info(plan_key=plan_key, branch_name=branch_name)
branch_number = branch_info['latestResult']['number']
But it's breaking on the second line now. Looks like branch_info doesn't hold the latestResult anymore?
Also, I tried using bamboo.build_latest_result(plan_key=branch_key) and that also doesn't work. I might be missing something silly.
Hello Jonathan,
I am not an expert in Python, but you can get these info by Bamboo REST API's
1) Use the below REST API to filter all the branches for a plan
/rest/api/latest/plan/plan-key/branch , refer https://docs.atlassian.com/atlassian-bamboo/REST/8.2.5/#d2e2400
2) Using the below API you can get the branch status
/rest/api/latest/result/<branch-key>, refer https://docs.atlassian.com/atlassian-bamboo/REST/8.2.5/#d2e3305
You can refer the below community article for details > https://community.atlassian.com/t5/Bamboo-articles/How-to-list-plan-build-status-using-REST-API/ba-p/1142159
Thanks for your reply! I think it's specific to the Python API then because I was able to get the latest result through rest using /rest/api/latest/result/<branch-key>
But in Python, bamboo.latest_result(plan_key) doesn't work if I use the branch_key for the play_key argument.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.