Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-18667

(REST) Misleading parameters: projectKey buildKey

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Low Engagement
    • Icon: Low Low
    • None
    • 6.1.1
    • REST API

      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

      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

        1. bamboo.variable.planKey.png
          79 kB
          Rafael Sperafico

              Unassigned Unassigned
              rsperafico Rafael Sperafico (Inactive)
              Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: