I have created a Bamboo project ( version 9.2.11) with a plan that includes stages jobs and tasks. I have not yet built the project only configured the plan stages jobs and tasks.
I am able to use the REST API to query project and plan information with no problem.
For example, "https://bamboo....../bamboo/rest/api/latest/project/<PROJECT-KEY>" returns my project name.
For example, "https://bamboo....../bamboo/rest/api/latest/project/<PROJECT-KEY>?expand=plans" returns a list of my plans
For example, "https://bamboo....../bamboo/rest/api/latest/plan/<PLAN-KEY>?expand=stages" returns stages for a given plan.
These all work fine. The issue comes in when I attempt to query deeper into a stage to get job and task information. What would the syntax be list out all the jobs in a stage? What about all the tasks in a job? What about the config information for a task?
Thanks
Hello Ron,
Welcome to Atlassian Community.
For Jobs you can use the below REST API, details are available here
curl --request GET \
--user user_id:password \
--url 'http://bamboo921:8085/rest/api/latest/search/jobs/PLAN-KEY' \
--header 'Accept: application/json'
For Tasks currently there is no REST API, however there is a feature request created you can refer for more details BAM-20540 API to produce a list of build plans and their corresponding tasks
There are couple of workarounds you can follow for example
1. Export the plan as specs via REST API to view all the plans, Jobs and the Tasks
2. Run a DB query to extract the result from the Database.
Do let me know if anyone of the workarounds interests you, I'll try to help you with that.
Regards,
Shashank Kumar
**please don't forget to Accept the answer if your query was answered**
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.