Hi, Guys.
I have a problem with script runner. could you help me?
I use cascading field and I know how to check validation via script runner, Like this 'cfValues["Complaint type"]?.keySet()?.size() == 2'
but I just wanna add one more condition with some of issue type.
for example, issuetype name is 'complaint' . I just fill out scriprunner as below, but I have failed.
(1) issue.issueType.name == 'Complaint' || cfValues["Complaint type"]?.keySet()?.size() == 2
(2) if (issue.issueType.name == 'Complaint') {
cfValues["Complaint type"]?.keySet()?.size() == 2}
where is my pain point?
Best regards,
Nate
Hello
Could you please share the full validation condition that you want to implmement, what do you mean by "cfValues["Complaint type"]?.keySet()?.size() == 2'"
In your validation you want the issueType to be "Complaint" and what's the other condition which you want?
Sorry, My description was not enough.
I just wanna add 'validation for multi-cascading' in Customfield 'Complaint type' when issue type is 'Complaint'. I don't wanna apply other issue types.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
It should be easy to implement with SR plugin
But you still have not described as to what kind of validation you want to add for the custom field "Complaint type" , should it have single value or should it have both values or should it have certain specific values.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if(issue.issueType.name == 'Complaint') {
if (cfValues['Complaint type']?.values()*.value == ['AA', 'AB']) {
return true;
} else {
return false;
}
}
return true;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the above example, replace AA, AB values with the values of your custom field "Complaint type"
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.