6

In Teamcity 9.* I have a Build Template with some Configuration parameters that will be different depending on the project that will be created from it. This parameter is important and must be entered during creation otherwise the build will not work. So my question is:

Is there a way to configure this parameter as Mandatory during Build Creation Dialog? Teamcity actually has the Name field as mandatory.

I tried to define the parameter as "Text" and with validator "Not Empty". Also using the REGEX but without success. This kind of validator seems to work only running the Custom Builds.

Tonino
  • 1,137
  • 10
  • 25

1 Answers1

6

No, unfortunately there is no way to achieve this.

The only way to see this is by looking at your parameters after you've created a build configuration from a template and this will show the required parameters (i.e. they are referenced in build steps / other variables somewhere)

Here you can see a configuration based on a template. The values aren't set in the template or at the point of creating the build configuration

enter image description here

If you fail to supply any of these values, then your build will sit in the build queue and the error message will be "unable to run on any agents due to missing parameter values"

Matt
  • 3,684
  • 1
  • 17
  • 19
  • Hi Thanks for your answer. I have the configuration as below Type: Text Allowed Value: Not Empty But if I create the build from the template, the value is displayed as as in your screenshot for the Buld Artifact variable. The is shown only in the template and not during build creation of afterwards and the "Unable to run on any agent" is not displayed because this variable is processed as empty anyway. – Tonino Aug 02 '16 at 10:17
  • The moment you configure the parameter's type, it will change to instead of – Matt Aug 02 '16 at 17:29
  • You could always setup a validation step top manually validate your parameters via a script - Not ideal I know, but just a suggestion :) – Matt Aug 03 '16 at 10:18
  • yes it will be the way to do that but I thought that the parameter Validation feature was usefull for a validation :). Thanks again for your quick feedbacks! – Tonino Aug 03 '16 at 13:47