6

I have a parameter for which I'm showing a prompt. I've set a default value for it and that works fine.
What doesn't work, however, is that if I choose to enter a different value when running the build, then on the next build this value automatically becomes the new default value, so to say.

I'd like the default value to always be fixed and if you enter a different value in the field, then that value will be used just for this build (and the next build will fallback to the fixed, default value for this parameter).

Is this possible and how can it be done?

Eliran Malka
  • 15,821
  • 6
  • 77
  • 100
carlspring
  • 31,231
  • 29
  • 115
  • 197

2 Answers2

5

Currently it's not possible. The related request is https://youtrack.jetbrains.com/issue/TW-21453, please vote. As of now you can use "Reset" link.

Alina Mishina
  • 3,320
  • 2
  • 22
  • 31
2

As far as I know, there's no built-in solution for this.

To solve your problem, you could use a Command Line (or Powershell) Build Runner that runs as the last step of the build. There you can reset your parameter by setting it to the desired default value using this as script content:

##teamcity[setParameter name='your.parameter' value='desiredDefaultValue']

I would recommend using a separate parameter to save desiredDefaultValue instead of a hard-coded value.

Eliran Malka
  • 15,821
  • 6
  • 77
  • 100
Mecaveli
  • 1,507
  • 10
  • 16
  • Sorry, I had to downvote this. I am facing the same issue. The thing is, this resets the parameter's default value, but it won't reset the value the user inserted. So next time the user clicks run, the dialog will still contain the old value. – Patkos Csaba May 04 '18 at 15:09