How to enable Global Variables REST API
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:
- Stop Bamboo
- Add -Datlassian.darkfeature.bamboo.experimental.rest.admin.enabled=true by following the instructions of Configuring your system properties
- Start Bamboo
With this feature, the following API endpoint will become available: <bamboo-url>/rest/admin/latest/globalVariables
Function | HTTP Method | Endpoint | Payload |
---|---|---|---|
List | GET | <bamboo-url>/rest/admin/latest/globalVariables | NONE |
Add | POST | <bamboo-url>/rest/admin/latest/globalVariables | JSON:
|
Update | PUT | <bamboo-url>/rest/admin/latest/globalVariables/<variable-id> | JSON: Any of
|
Remove | DELETE | <bamboo-url>/rest/admin/latest/globalVariables/<variable-id> | NONE |