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

As an admin, I would like to set up Variables in Bamboo using REST API

    XMLWordPrintable

Details

    • 1
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      This suggestion comes from requests made in the Atlassian Community (https://community.atlassian.com/t5/Bamboo-questions/Why-doesn-t-Bamboo-s-REST-API-support-reading-and-writing/qaq-p/958960, https://community.atlassian.com/t5/Bamboo-questions/How-do-I-get-Deployment-variables-via-REST-API/qaq-p/633329) and other sources in which find very difficult setting up Variables in Bamboo, forcing users to manage them from Bamboo's UI instead.

      As it stands now, Bamboo Java Specs provides us with a way to work with Variables in Bamboo (https://docs.atlassian.com/bamboo-specs-docs/6.7.2/specs-java.html#variables). However, this approach seems to be restricted to Plan / Environment variables as there is/are no example on making variables available to the Global scope in Bamboo.
      There is no example in Variables related to Environment variables, but here is an example:

      Deployment deployment = new Deployment(new PlanIdentifier("PROJ", "PLAN"), "My Deployment")
      		.environments(new Environment("My Environment")
      			.variables(new Variable("myEnvironmentVariable","FROM ENVIRONMENT")));
      

      The downside of using Bamboo Java Specs is that you have to set up your environment with Maven, Java and such in order to publish your changes against your Bamboo Server instance. If this is not the case, then you would required to go through the repository configuration, making your source code available as Specs in Bamboo, setting you Git, commit your changes and so on...

      For reasons described above, it would be much easier/appreciated having REST API endpoint available for:

      • viewing, creating, updating, deleting Global Variables
      • viewing, creating, updating, deleting Plan Variables
      • viewing, creating, updating, deleting Environment Variables

      At the moment, there are two endpoint that can be used to view variables and they are described in BAM-16056 and BAM-18006. However, you have to consume Bamboo actions in order to create variables (as described in https://community.atlassian.com/t5/Bamboo-questions/How-do-I-get-Deployment-variables-via-REST-API/qaq-p/633329), meaning that you have to dig into web browser requests in order to get the correct action and parameters to create variables. Not to mention how difficult it is to update or delete a variable (in which requires its id). Unfortunately, not everyone has knowledge in web requests, meaning that users should have a way to accomplish things (configuration in this case) in an easier manner.

      Attachments

        Issue Links

          Activity

            People

              72548a1cec6d Wioletta Dys
              9b14394e5f65 Rafael Pinto Sperafico
              Votes:
              19 Vote for this issue
              Watchers:
              15 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: