Dynamically pass properties to the build definition
3 answers
Hi Abraham, properties that are flagged as Required in Build Forge get marked as REQUIRED (keyword in the description field) in the corresponding property in the build definition (when first selected, or when properties are synchronized).
There are a couple of gaps here though:
1) a value has to be given in the build definition, it cannot be left blank
2) validation is not done in the request build dialog, but is done when the integration picks up the build request (still before sending to BF). If you submit a build with an empty required property, it fails with an error log with something like:
Error occurred while validating a REQUIRED property type. The property in error is Required_Message=. Please review the Properties tab of the Build Definition to resolve issues prior to running the build.
We have an existing story for this: As a Build Forge user I can easily edit BF properties from RTC, with proper validation (150608), covered by backlog plan item: [CCM] Improve the RTC / Build Forge integration (233532)
You can additionally mark variables with a "must-change" attribute which will require the user to interactively enter the values for the variables on the job start page.
You can read about the must change attribute In the BuildForge Infocenter
- Must Change: The variable value must be changed. Top-level variables with this property are highlighted in the Start panel; if a new value is not entered, the job cannot be quick-started or started.
Note: If a job that contains Must Change variables is started by the scheduler rather than a user, the variable values are not changed. Also, if a job that contains Must Change variables is started by a class property, the variable values are not changed. Class properties include Start on purge, Start on entry, and Start on exit.
Thanks Nick for your response. I had the issue where I was unable to save the Build Definition without providing the value to the Required variables. BUt consider a scenario where these required fields are like USR_ID and USR_PWD, which needs to be entered by a user requesting a build and not by an administrator who is creating a Build Definition for an application team. How would one get around this scenario? I don't want to have dummy values in these fields and I want user to be forced to enter valid values to these variables when requesting a Build. I have similar variables in Build Forge which are required when start a project like "BUILD_WI" id which will be different for each build request (so saving as a part of Build Definition does not make sense).