Support for Result and Local scoped variables

Description

Bamboo 5.7 introduced local scope and result scope variables. These resolve many issues people have had specifically with Deployment Versions:

Details from Atlassian

Marcin Gardias [Atlassian] added a comment - 16/Oct/14 11:23 AM - edited
As of Bamboo 5.7 the correct way to add variables at runtime is:

@Override public TaskResult execute(@NotNull CommonTaskContext taskContext) throws TaskException { final VariableContext variableContext = taskContext.getCommonContext().getVariableContext(); variableContext.addResultVariable("mykey", "myvalue"); //add result-scoped variable variableContext.addLocalVariable("myotherkey", "myothervalue"); //add local-scoped variable // (...) }

where
"result-scoped" variable is persisted with the result and can be accessed in subsequent stages and in related deployments, while "local-scoped" variable disappears when current job's execution ends.

Environment

None

Activity

Show:
Fixed

Details

Assignee

Reporter

Priority

Created November 24, 2014 at 11:35 PM
Updated January 28, 2015 at 1:48 AM
Resolved January 28, 2015 at 1:48 AM