-
Bug
-
Resolution: Low Engagement
-
Low
-
None
-
6.1.1
-
Severity 3 - Minor
-
0
-
Summary
Following endpoint in https://docs.atlassian.com/bamboo/REST/6.1.1 do not work due to misleading parameters:
http://myhost.com:8085/bamboo/rest/api/latest/dependency/search/{projectKey}-{buildKey}/child [GET] http://myhost.com:8085/bamboo/rest/api/latest/dependency/search/{projectKey}-{buildKey}/parent [GET] http://myhost.com:8085/bamboo/rest/api/latest/clone/{projectKey}-{buildKey}:{toProjectKey}-{toBuildKey} [PUT] http://myhost.com:8085/bamboo/rest/api/latest/queue/{projectKey}-{buildKey} [POST] http://myhost.com:8085/bamboo/rest/api/latest/queue/{projectKey}-{buildKey}-{buildNumber : ([0-9]+)} [PUT, DELETE] http://myhost.com:8085/bamboo/rest/api/latest/plan/{projectKey}-{buildKey} [GET] http://myhost.com:8085/bamboo/rest/api/latest/plan/{projectKey}/{buildKey} [GET] http://myhost.com:8085/bamboo/rest/api/latest/plan/{projectKey}-{buildKey}/branch [GET] http://myhost.com:8085/bamboo/rest/api/latest/plan/{projectKey}-{buildKey}/branch/{branchName} [PUT, GET] http://myhost.com:8085/bamboo/rest/api/latest/plan/{projectKey}-{buildKey}/label [GET, POST] http://myhost.com:8085/bamboo/rest/api/latest/plan/{projectKey}-{buildKey}/label/{labelName} [DELETE] http://myhost.com:8085/bamboo/rest/api/latest/plan/{projectKey}-{buildKey}/vcsBranches [GET] http://myhost.com:8085/bamboo/rest/api/latest/plan/{projectKey}-{buildKey}/issue/{issueKey} [GET] http://myhost.com:8085/bamboo/rest/api/latest/plan/{projectKey}-{buildKey}/favourite [POST, DELETE] http://myhost.com:8085/bamboo/rest/api/latest/plan/{projectKey}-{buildKey}/enable [POST, DELETE] http://myhost.com:8085/bamboo/rest/api/latest/plan/{projectKey}-{buildKey}/artifact [GET] http://myhost.com:8085/bamboo/rest/api/latest/plan/{projectKey}-{buildKey}/test/{testId}/quarantine [POST] http://myhost.com:8085/bamboo/rest/api/latest/plan/{projectKey}-{buildKey}/test/{testId}/unleash [POST] http://myhost.com:8085/bamboo/rest/api/latest/result/{projectKey}-{buildKey}-{buildNumber : ([0-9]+)|(latest)} [GET] http://myhost.com:8085/bamboo/rest/api/latest/result/{projectKey}-{buildKey} [GET] http://myhost.com:8085/bamboo/rest/api/latest/result/{projectKey}-{buildKey}/branch/{branchName} [GET] http://myhost.com:8085/bamboo/rest/api/latest/result/{projectKey}-{buildKey}/{buildNumber : ([0-9]+)|(latest)} [GET] http://myhost.com:8085/bamboo/rest/api/latest/result/{projectKey}-{buildKey}-{buildNumber}/comment [GET, POST] http://myhost.com:8085/bamboo/rest/api/latest/result/{projectKey}-{buildKey}-{buildNumber}/label [GET, POST] http://myhost.com:8085/bamboo/rest/api/latest/result/{projectKey}-{buildKey}-{buildNumber}/label/{labelName} [DELETE] http://myhost.com:8085/bamboo/rest/api/latest/result/status/{projectKey}-{buildKey}-{buildNumber : ([0-9]+)} [GET]
Environment
- Setting up Project - Plan in Bamboo, runnig a few builds
- Referring to Bamboo variables documentation we have:
Build-specific variable Description bamboo.buildKey The job key for the current job, in the form PROJECT-PLAN-JOB, e.g. BAM-MAIN-JOBX bamboo.planKey The key of the current plan, in the form PROJECT-PLAN, e.g. BAM-MAIN bamboo.shortPlanKey The short key of the current plan (without project part), e.g. MAIN bamboo.shortJobKey The short key of the current job (without project and plan parts), e.g. JOBX bamboo.buildResultKey The result key when this job executes, in the form PROJECT-PLAN-JOB-BUILD e.g. BAM-BOO-JOB1-8, where '8' is the build number.
For deployment projects this variable will not have the JOB component e.g. PROJ-TP-6.bamboo.buildNumber The Bamboo build number, e.g. 123
Steps to Reproduce
- run the following cURL command, making use of Bamboo variables documentation as referencehttp://myhost.com:8085/bamboo/rest/api/latest/plan/
{projectKey}-{buildKey} [GET]
curl -u admin:admin -H 'accept: application/json' \ -H 'content-type: application/json' \ -X GET 'http://localhost:8085/rest/api/latest/plan/PROJ-PROJ-PLAN-JOB1'
Results
The above results on an error:
{ "message": "Plan PROJ-PROJ-PLAN not found.", "status-code": 404 }
Notes
As we can notice from above, the endpoint refers to {projectKey}-{buildKey}:
- {projectKey} is not an available varialbe in Bamboo variables documentation
- In Bamboo's UI, there is a reference to Project Key (e.g. PROJ) in which is not mentioned in Bamboo variables documentation
- {projectKey}-{buildKey} is not a valid key
- In Bamboo's UI, there is a reference to Plan Key (e.g. PLAN) in which differs from Bamboo variables documentation