10

I have complex jobs with a lot of parameters, is there any way to validate those parameters using JavaScript form validation or with some other methods, and if the user's input isn't not correct, i'll show an error message and also disable the build button. I've tried installing the Validating String Parameter Plugin , it seems like that it's only displaying errors

Furkan Yavuz
  • 1,858
  • 5
  • 30
  • 51
Alex Brodov
  • 3,365
  • 18
  • 43
  • 66

2 Answers2

3

You can combine:

That way:

  • the validating String parameter plugins prevents users to enter invalid values
  • the script (written in any language you want) will validate those parameters again, but this time called as a "Script Condition", to decide if a step should be executed or failed.

That ensures that, even if the job is called directly through API (without any string validation from the first plugin), the script (called by the second conditional step plugin) will block/fail the job if its execution (validating the strings/parameters by script) does end with a failure status.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

At the moment, the validating string parameter is the closest you'll get.

Andrew Gray
  • 3,593
  • 3
  • 35
  • 62