Hello Team,
Can you please help me with this validator?
We have a field "XYZ" with Yes/No/Unknown options, default value set to Unknown and to push the workflow status to In-progress we need this field's options be either Yes or No. Can you please help ASAP? Thanks!
Hi @Sravan Duddella from the Scriptrunner page
cfValues['My Multi Select']*.value.contains("Some value")
Scriptrunner validators simple-scripted-validators-multi-select
Here's a more complex example from the Scriptrunner Library
Scriptrunner Library Scripted Validator Multi-Select List
I hope this helps to get you started.
Happy Scripting.
Hello Craig, Thanks for posting this, so the field is single select but the value can be either Yes or No.
using the below argument is throwing errors, looking forward for some help on the right argument to use.
cfValues['xyz']?.value == "Yes or No"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Instead of testing for Yes or No why not test what it is not equal to.
re:
cfValues['xyz']?.value != "Unknown"
or to test for the OR
cfValues['Demo']?.value == 'Yes' || cfValues['Demo']?.value == 'No'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
AWESOME! Worked like a charm!!! Thank you so much!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Old guy tip.
I hope you used the != to simplify complexity.
Reasoning here is the only value that is invalid is "Unknown" all other values are valid, so therefore you only need to test that the value is not equal to "Unknown".
Testing for the OR requires the system to evaluate the value twice, adding unnecessary complexity to the scripted validator which may be difficult for someone new reading it later on down the line.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Understood!! Makes complete sense and a lot much easy to implement and read. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.