Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Validating cascading select does not work

Stephen Letch
Contributor
January 17, 2019

Hi

 

In the Scriptrunner documentation it states

Validating Cascading Selects

Cascading selects will return you a Map<String,Option>. In the following examples, CascadingSelect is the name of a, you guessed it, cascading select field.

Validate that both dropdowns of a cascading select are filled:

cfValues["CascadingSelect"]?.keySet()?.size() == 2

 

Here is my current set up

casc1.PNG

As you can see here, both are filled yet it will not work

validation.png T

Through a lot of testing I'm finding it either works too much or too little depending on what I throw at it. Spent an entire day trying to get this to work and getting a bit sick of scriptrunners skill level requirements and inconsistencies./

 

Any help would be appreciated

1 answer

0 votes
Mark Markov
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 17, 2019

Hello @Stephen Letch

As i can see from screenshot, you forgot to change fieldname in code

In your case it will be 

cfValues["Service Request Type"]?.keySet()?.size() == 2
Stephen Letch
Contributor
January 17, 2019

Done that, seems to be working, now I need to see if it's going to be nice enough to only apply it to specific issue types on the same workflow.

Stephen Letch
Contributor
January 17, 2019 edited

All I want to do is

if service request, require both levels of 'Service Request type' to be filled.

if Incident require both levels of incident type to be filled

if any other issue type ignore.

Stephen Letch
Contributor
January 17, 2019
if(issue.issueType.name == 'Service Request'){cfValues["Service Request Type"]?.keySet()?.size() == 2}

This just makes this happen to Incidents (bounces to the last tab and wont let it happen

error.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events