help me please with validation on workflow (create issues)
jmwe conditions
required fileds value must be not empty and !=0
issue.get("customfield_10803")!=0 && issue.get("customfield_10804")!=0
this one should works but it`s not
Hi @vsoldatova ,
are these Number custom fields? And are you using this script in a "Scripted (Groovy) Validator"?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to create a Scripted (Groovy) Validator, not a Field Required Validator. Conditional Validation will simply skip validation if the script returns false.
Then the script of the Scripted (Groovy) Validator should be:
issue.get("customfield_10803") && issue.get("customfield_10803") !=0 && issue.get("customfield_10804") && issue.get("customfield_10804") !=0
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes, thanks! I used two validators. required and Scripted (Groovy) Validator,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@David Fischer
@Florian Bonniec
could you also help with linked issue type, please!
When test (issue type) created i need :
1. linkedtype is "tests"
2. linked was possible only with sub-task (issuetype)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @vsoldatova ,
I'm sorry but I don't understand what you're trying to achieve. Can you please rephrase?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@David Fischer
how can I write script in the Scripted (Groovy) Validator?
required linked type = "name"
required linked issue type = "name"
something like this?
issue.get("issuelinks")equals("tests") && issue.get("issuelinkstype")equals("sub-task")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why don't you simply use a Related Issues Validator? It will allow you to validate this without any scripting
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @vsoldatova
First your fields has to be number field, if it's not the case and theyr are text fields, you have to cast them into double or integer.
Also I think you should check if a value exist for your field before.
So can you try something like
( issue.get("customfield_10803") && issue.get("customfield_10803") !=0 ) &&
( issue.get("customfield_10804") && issue.get("customfield_10804") !=0 )
Because it my interpret null != 0 as true.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes, for sure there`re number fields.
it`s not working as well
( issue.get("customfield_10803") && issue.get("customfield_10803") !=0 ) &&
( issue.get("customfield_10804") && issue.get("customfield_10804") !=0 )
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.