I'm looking to create a customer report but I can't find any documentation or examples on how to do this. Any guidance would be appreciated!
Hello @christok
Please tell me that you can use a bash script for that!Otherwise, you will need to transcript the script I just did for you.
It uses the following rest APIs:
Reference: Bamboo REST API documentation 6.9.2
It also uses ./jq command-line JSON processor to filter the results.
#!/bin/bashUSER=adminPASSWORD=adminBAMBOO_URL=http://localhost:8085/bambooPROJECTS=`curl -s -u $USER:$PASSWORD \-H 'Accept: application/json' \-X GET "$BAMBOO_URL/rest/api/latest/project" \| jq -r '.projects.project[] | .key'`PLANS=""for PROJECT in $PROJECTSdo PROJECT_PLANS=`curl -s -u $USER:$PASSWORD \ -H 'Accept: application/json' \ -X GET "$BAMBOO_URL/rest/api/latest/project/$PROJECT?expand=plans" \ | jq -r '.plans.plan[] | .key'` PLANS+=" $PROJECT_PLANS"donePLANS_AND_BRANCHES=""for PLAN in $PLANSdo PLANS_AND_BRANCHES+=" $PLAN" BRANCHES=`curl -s -u $USER:$PASSWORD \ -H 'Accept: application/json' \ -X GET "$BAMBOO_URL/rest/api/latest/plan/$PLAN/branch" \ | jq -r '.branches.branch[] | .key'` PLANS_AND_BRANCHES+=" $BRANCHES"donefor PLAN_BRANCH in $PLANS_AND_BRANCHESdo curl -s -u $USER:$PASSWORD \ -H 'Accept: application/json' \ -X GET "$BAMBOO_URL/rest/api/latest/result/$PLAN_BRANCH" \ | jq -r '.results.result[0] | "Plan:" + .key + " Name:\"" + .plan.name + "\" lifeCycleState:" + .lifeCycleState + " buildState:" + .buildState'done
Another option is to build a Bamboo plugin for that. If you decide on this approach I suggest you follow this document:
I hope that helps.
It looks like you're new here. Sign in or register to get started.