Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

How do I a Package Variable value via API



  • I was looking to get the value of a Package Variable with the API but I can't seem to find how to do it.
    I've tried using the GetVariableValues passing variations of some/all of the following: Environment_id, Application_Id, Release_Number, Build_Number, and Execution_Id but I always just get no values back.

    I can use the GetPackageVariables but that does not give me their values only their names, at least it doesn't appear to. There are fields in the response that say Variable Value but it is not what the real value is and is instead a string of characters that do not make any sense. The fields are not set as sensitive either.

    The response to GetPackageVariables looks like this:

     [{"Build_Id":723,
     "Variable_Name":"buildVersion","ValueType_Code":"S","Variable_Value":"MTQuMS4wLjI1", "Sensitive_Indicator":false,"EvaluateVariables_Indicator":false},
     {"Build_Id":723,"Variable_Name":"JenkinsBuildNumber","ValueType_Code":"S","Variable_Value":"ODQ3","Sensitive_Indicator":false, "EvaluateVariables_Indicator":false}]
    

    Thanks.

    Product: BuildMaster
    Version: 5.6.11


  • inedo-engineer

    Hello Jon,

    I would suggest using the variables management API. In this case, the endpoint would be GET /api/variables/packages/«application-name»/«release-number»/«package-number»?key=«api-key» to get all the variables associated with a package.



  • Ben,
    thanks. Sorry I meant to close this one off yesterday as I posted another issue about using the variable api.
    I was using the API for something else and I had forgotten about the variable portion of it. I saw in the doc while looking at another one so I did go and try to use that.



  • lol, boy I really need to quit doing 5 things at once.

    Thanks for the answer Ben. Thought you were answering another one I posted that I had meant to close.

    Going to drink my coffee now and hopefully wake up!


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation