Hello,
I am stuck with something which seems to be very easy but somehow I cannot figure it out.
We want to have a Workflow validator during a transition that will check the following:
Single Select Custom Field (User Pickup) called Code Reviewer value does not exist in
Developer(s) - Multi Select Custom Field (User Pickup).
Example, if we have:
Code Reviewer = John Smith
Developer(s) = John Smith (may include more users eg. Peter Goosters, Dave Jones)
The transition should throw an error.
I am using Script Validator [ScriptRunner] - Simple scripted validator and I tried the following without success:
cfValues['Developer/s'] != cfValues['Code Reviewer']
!(cfValues['Developer/s']*.value.contains(cfValues['Code Reviewer']?.value))
(cfValues['Developer/s'] as int) >= (cfvalues['Code Reviewer'] as int)
cfValues['Developer/s']*.value != cfValues['Code Reviewer']?.value
Any help Is highly appreciated. I guess I will need to write more complex code to extract the multiselect values and compare them with my single select fields but I don't know how. And also I don't know if because these are user field it's even more complicated :)
Thanks in advance
Hi @TIS Admin,
I haven't run this snippet, but you may wish to try like below
cfValues['Code Reviewer']*.value in cfValues['Developer/s']*.value
BR,
Leo
Hi Leo, how this can be translated to validate that transition will proceed if there is no match?
Something like?
!(cfValues['Code Reviewer']*.value in cfValues['Developer/s']*.value)
Or do I have to use if and throw exceptions?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you place this in condition then the transition button visible only if the condition passes
if you want to validate the values which is entered during transition using transition screen then you'll have to go with either validator or behaviour(I prefer behaviour in this scenario)
BR,
Leo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, I was not clear enough. I want to allow the transition only if the value of Code Reviewer is not found in the Developer/s multi-select field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
cool, this is pretty easy, place below snippet in conditions instead of validator
cfValues['Code Reviewer']*.value not in cfValues['Developer/s']*.value
if the condition fails, you'll see that particular transition hidden until the condition becomes true
BR,
Leo
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.