• Icon: Suggestion Suggestion
    • Resolution: Answered
    • None
    • REST API
    • None
    • 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.

      Its possible to set Global Variables through the REST API, and to set Plan Variables when executing a build but I can't find a way to permanently set a Plan Variable.

      Rationale is I can create branch plan's, set to my VCS branch through REST API, I can enable, favourite and add labels, but the most important part is to set the Plan Variables which override the parent (or global) variables for this branch.

      Referencing https://answers.atlassian.com/questions/35774012/how-to-update-plan-or-global-variable-using-rest-api and https://jira.atlassian.com/browse/BAM-9344 but can't see if this is or isnt a dark feature?

      If it is - can I have an example of POST setting a planvariable?

      If it isn't - can this be added asap to make the REST API useful for creation of plan branches?

            [BAM-18266] Set Plan Variables through REST API

            James Whitehead made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 529164 ]

            Rob Fagen added a comment -

            Any thoughts on how this might interact with Plan variables that are secrets (and so encrypted in the DB with a leading "BAMSCRT..." ? Likewise, how would you manage a Spec where you wanted to embed the secret in the plan? Is there an API for creating a BAMSCRT value?

            Rob Fagen added a comment - Any thoughts on how this might interact with Plan variables that are secrets (and so encrypted in the DB with a leading "BAMSCRT..." ? Likewise, how would you manage a Spec where you wanted to embed the secret in the plan? Is there an API for creating a BAMSCRT value?
            Katherine Yabut made changes -
            Workflow Original: JAC Suggestion Workflow [ 3015707 ] New: JAC Suggestion Workflow 3 [ 3606745 ]
            Status Original: RESOLVED [ 5 ] New: Closed [ 6 ]

            sscaff1 please use VariableConfigurationService.createPlanVariable

                /**
                 * Creates new Plan variable.
                 * @param plan plan the variable belongs to
                 * @param variableKey variable key.
                 * @param variableValue variable value
                 * @return created {@link VariableDefinition}
                 * @throws IllegalArgumentException iff variable key is not unique
                 */
                @NotNull
                VariableDefinition createPlanVariable(@NotNull Plan plan, @NotNull String variableKey, @NotNull String variableValue);
            

            Krystian Brazulewicz added a comment - sscaff1 please use VariableConfigurationService.createPlanVariable /** * Creates new Plan variable. * @param plan plan the variable belongs to * @param variableKey variable key. * @param variableValue variable value * @ return created {@link VariableDefinition} * @ throws IllegalArgumentException iff variable key is not unique */ @NotNull VariableDefinition createPlanVariable(@NotNull Plan plan, @NotNull String variableKey, @NotNull String variableValue);
            Owen made changes -
            Workflow Original: Confluence Workflow - Public Facing v4 [ 2702336 ] New: JAC Suggestion Workflow [ 3015707 ]
            Owen made changes -
            Issue Type Original: Improvement [ 4 ] New: Suggestion [ 10000 ]
            Owen made changes -
            Workflow Original: Bamboo Workflow 2016 v1 [ 1770311 ] New: Confluence Workflow - Public Facing v4 [ 2702336 ]

            kbrazulewicz I'm trying to expose a REST endpoint for modifying Plan variables. I've looked through the Atlassian docs here https://docs.atlassian.com/atlassian-bamboo/6.4.1/. I don't see what classes/services I should be using to do this. My initial stab was at com.atlassian.bamboo.variable.VariableConfigurationService. There is a method called setPlanVariables which seems to be what I want. However, I'm not sure how VariableProperties are defined, and I can't find documentation for it in the docs linked. Any help is appreciated.

            Steven Scaffidi added a comment - kbrazulewicz  I'm trying to expose a REST endpoint for modifying Plan variables. I've looked through the Atlassian docs here https://docs.atlassian.com/atlassian-bamboo/6.4.1/.  I don't see what classes/services I should be using to do this. My initial stab was at com.atlassian.bamboo.variable.VariableConfigurationService. There is a method called setPlanVariables which seems to be what I want. However, I'm not sure how VariableProperties are defined, and I can't find documentation for it in the docs linked. Any help is appreciated.

            Since v6.3 bamboo has also supported multiple plan repositories. Is it possible to use the API to update the Plan repository branches, since you can't update Plan variables via the API?

            ClearlyRated added a comment - Since v6.3 bamboo has also supported multiple plan repositories. Is it possible to use the API to update the Plan repository branches, since you can't update Plan variables via the API?
            Krystian Brazulewicz made changes -
            Resolution New: Answered [ 9 ]
            Status Original: Needs Triage [ 10030 ] New: Resolved [ 5 ]

              Unassigned Unassigned
              8d52fd7dd939 David Holsgrove
              Votes:
              4 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: