How to enable Global Variables REST API

Still need help?

The Atlassian Community is here for you.

Ask the community


Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Sometimes it is necessary to manage global variables through the REST API.

Solution

Bamboo does have an API for Global variables, which can list, add, update, and remove Global variables. This API is currently considered a "dark feature" meaning that it's not enabled by default.

This feature can be enabled as follows:

  1. Stop Bamboo
  2. Add -Datlassian.darkfeature.bamboo.experimental.rest.admin.enabled=true by following the instructions of Configuring your system properties
  3. Start Bamboo

With this feature, the following API endpoint will become available: <bamboo-url>/rest/admin/latest/globalVariables

Function

HTTP Method

Endpoint

Payload

ListGET<bamboo-url>/rest/admin/latest/globalVariablesNONE
AddPOST<bamboo-url>/rest/admin/latest/globalVariablesJSON:
  • name (required)
  • value (optional)
UpdatePUT<bamboo-url>/rest/admin/latest/globalVariables/<variable-id>JSON: Any of
  • name (optional)
  • value (optional)
RemoveDELETE<bamboo-url>/rest/admin/latest/globalVariables/<variable-id>NONE

Last modified on Jan 26, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.